Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mattholy committed Feb 5, 2024
1 parent 3656f8c commit 6d8cd48
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ on:
release:
types: [published]

env:
TEST_TAG: mattholy/wand:dev

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

Expand All @@ -17,9 +26,20 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}

- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand All @@ -29,5 +49,12 @@ jobs:
push: true
provenance: mode=max
sbom: true
tags: mattholy/wand:${{ steps.extract_tag.outputs.tag }}
build-args: VERSION=${{ steps.extract_tag.outputs.tag }}
tags: mattholy/wand:${{ steps.extract_tag.outputs.TAG_NAME }}
build-args: VERSION=${{ steps.extract_tag.outputs.TAG_NAME }}

- name: Update repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
repository: mattholy/wand

0 comments on commit 6d8cd48

Please sign in to comment.