-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳 add a CI job to publish docker images (#266)
This PR adds a CI workflow to build and publish the corresponding Docker container to Docker Hub.
- Loading branch information
1 parent
a5336b0
commit 2901111
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
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 | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: burgholzer/mqt-ddvis | ||
|
||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: ${{ github.event_name != 'pull_request' }} |