v0.0.1-dev.09 #10
Workflow file for this run
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
name: Push Docker image on release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get the Ref | |
id: tag-gen | |
uses: ankitvgupta/ref-to-tag-action@master | |
with: | |
ref: ${{ github.ref }} | |
head_ref: ${{ github.head_ref }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
provenance: mode=max | |
sbom: true | |
tags: | | |
mattholy/wand:${{ steps.tag-gen.outputs.tag }} | |
mattholy/wand:latest | |
ghcr.io/mattholy/wand:${{ steps.tag-gen.outputs.tag }} | |
ghcr.io/mattholy/wand:latest | |
build-args: VERSION=${{ steps.tag-gen.outputs.tag }} |