File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ name: Docker Build & Push
44
55on :
66 push :
7- tags :
8- - " * "
7+ branches :
8+ - main
99 workflow_dispatch : # Allows you to run this workflow manually from the Actions tab
1010
1111env :
3333 if : success()
3434 id : prepare
3535 run : |
36- echo "docker_platform=${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT
37- echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
38-
36+ re="^FROM caddy:([^-]+)"
37+ str=$(cat Dockerfile)
38+ tag=$(if [[ $str =~ $re ]]; then echo ${BASH_REMATCH[1]}; else exit 1; fi)
39+ echo "tag=$tag" >> $GITHUB_OUTPUT
40+
3941 - name : Login to Docker Hub
4042 uses : docker/login-action@v3
4143 with :
6971 ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
7072 quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }}
7173 quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
74+
75+ - name : Create Release
76+ uses : softprops/action-gh-release@v2
77+ with :
78+ tag_name : ${{ steps.prepare.outputs.tag }}
You can’t perform that action at this time.
0 commit comments