Skip to content

Commit

Permalink
Migrated to automatic tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
SlothCroissant committed Sep 14, 2024
1 parent 9a91de2 commit fca0cc5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Docker Build & Push

on:
push:
tags:
- "*"
branches:
- main
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab

env:
Expand Down Expand Up @@ -33,9 +33,11 @@ jobs:
if: success()
id: prepare
run: |
echo "docker_platform=${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
re="^FROM caddy:([^-]+)"
str=$(cat Dockerfile)
tag=$(if [[ $str =~ $re ]]; then echo ${BASH_REMATCH[1]}; else exit 1; fi)
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -69,3 +71,8 @@ jobs:
ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }}
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.prepare.outputs.tag }}

0 comments on commit fca0cc5

Please sign in to comment.