Build & Publish Docker Image #171
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 & Publish Docker Image | |
| on: | |
| workflow_run: | |
| workflows: ["Test"] | |
| branches: | |
| # change to main when merging to main | |
| - main | |
| types: | |
| - completed | |
| jobs: | |
| build: | |
| name: Build & Push | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| packages: write | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: 'Login to GitHub Container Registry' | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: reclaimprotocol | |
| password: ${{secrets.GITHUB_TOKEN}} | |
| - name: Build & Push Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| build-args: GH_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
| context: . | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max` | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ghcr.io/reclaimprotocol/${{ github.event.repository.name }}:${{ github.sha }} | |
| file: attestor.dockerfile |