|
40 | 40 | - name: Import environment ⛓
|
41 | 41 | run: cat "${GITHUB_WORKSPACE}/.build-env" >> $GITHUB_ENV
|
42 | 42 |
|
| 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 | + |
43 | 51 | - name: Cache Docker layers ♻️
|
44 | 52 |
|
45 | 53 | with:
|
@@ -75,13 +83,20 @@ jobs:
|
75 | 83 | - name: Build and push docker image 🗜
|
76 | 84 |
|
77 | 85 | with:
|
78 |
| - context: . |
| 86 | + context: "${{ github.workspace }}/application" |
79 | 87 | pull: true
|
80 | 88 | push: true
|
81 | 89 | platforms: linux/amd64,linux/arm64
|
82 | 90 | cache-from: type=local,src=/tmp/.buildx-cache
|
83 | 91 | 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 }} |
85 | 100 |
|
86 | 101 | # Temporary fix for growing caches
|
87 | 102 | # https://github.com/docker/build-push-action/issues/252
|
|
0 commit comments