Merge PR V2.0.1 #2
Workflow file for this run
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: Publish Docker image | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - main | |
| jobs: | |
| push_to_registry: | |
| name: Push Docker image to Docker Hub | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| # Only run this job if a tag is pushed on the main branch | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.ref_name == 'main' | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Extract tag name | |
| id: tag | |
| shell: bash | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
| with: | |
| images: digitalenvironments/hawki | |
| - name: Build and push Docker image | |
| id: push | |
| uses: docker/build-push-action@v6.15.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| target: app_prod | |
| tags: | | |
| digitalenvironments/hawki:latest | |
| digitalenvironments/hawki:${{ steps.tag.outputs.tag }} | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-name: index.docker.io/digitalenvironments/hawki | |
| subject-digest: ${{ steps.push.outputs.digest }} | |
| push-to-registry: true |