Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 4648520

Browse files
committed
fix: Fix docker publish workflow (2)
1 parent 7d17322 commit 4648520

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/publish-docker-image.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ jobs:
4040
- name: Import environment ⛓
4141
run: cat "${GITHUB_WORKSPACE}/.build-env" >> $GITHUB_ENV
4242

43+
- name: Extract semver numbers ⛓
44+
run: |
45+
echo "major=$(echo "$VERSION" | cut -d '.' -f 1 -)" >> $GITHUB_ENV
46+
echo "minor=$(echo "$VERSION" | cut -d '.' -f 2 -)" >> $GITHUB_ENV
47+
echo "patch=$(echo "$VERSION" | cut -d '.' -f 3 -)" >> $GITHUB_ENV
48+
env:
49+
VERSION: ${{ env.version }}
50+
4351
- name: Cache Docker layers ♻️
4452
uses: actions/[email protected]
4553
with:
@@ -75,13 +83,20 @@ jobs:
7583
- name: Build and push docker image 🗜
7684
uses: docker/[email protected]
7785
with:
78-
context: .
86+
context: "${{ github.workspace }}/application"
7987
pull: true
8088
push: true
8189
platforms: linux/amd64,linux/arm64
8290
cache-from: type=local,src=/tmp/.buildx-cache
8391
cache-to: type=local,dest=/tmp/.buildx-cache-new
84-
tags: "ghcr.io/${{ github.repository }}:latest"
92+
tags: |
93+
ghcr.io/${{ github.repository }}:latest
94+
ghcr.io/${{ github.repository }}:${{ env.version }}
95+
ghcr.io/${{ github.repository }}:${{ env.major }}.${{ env.minor }}
96+
ghcr.io/${{ github.repository }}:${{ env.major }}
97+
98+
- name: Image digest
99+
run: echo ${{ steps.docker_build.outputs.digest }}
85100

86101
# Temporary fix for growing caches
87102
# https://github.com/docker/build-push-action/issues/252

0 commit comments

Comments
 (0)