Build and Push Electros docker image #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Electros docker image | |
| on: | |
| push: | |
| branches: [ develop ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # build and push the docker image to ghcr.io | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.CI_TOKEN }} | |
| submodules: recursive | |
| ref: ${{ github.ref }} | |
| - name: Populate daemons folder | |
| run: | | |
| export CI_TOKEN=${{ secrets.CI_TOKEN }} | |
| ./populate_daemons.sh --platform linux --arch x64 --develop | |
| - name: Login to GHCR | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.REPO_KEY }} | |
| - name: Build and push Docker image | |
| run: | | |
| OWNER_NAME=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
| docker build -f docker/Dockerfile -t ghcr.io/${OWNER_NAME}/elemento-electros-instance:latest . | |
| docker push ghcr.io/${OWNER_NAME}/elemento-electros-instance:latest |