@@ -43,42 +43,57 @@ jobs:
4343 key : ${{ runner.os }}-buildx-${{ github.sha }}
4444 restore-keys : |
4545 ${{ runner.os }}-buildx-
46+ - name : Get version from semantic-release
47+ id : version
48+ run : |
49+ VERSION=$(npx semantic-release --dry-run | grep -oP 'The next release version is \K[0-9]+\.[0-9]+\.[0-9]+')
50+ echo "VERSION=$VERSION" >> $GITHUB_ENV
4651 - name : Build Docker images
4752 run : |
4853 echo "${{ secrets.GHCR_PAT }}" > github_token
4954 export DOCKER_BUILDKIT=1
55+ VERSION=$VERSION
56+ IMAGE=ghcr.io/ql4b/lambda-shell-runtime
5057
5158 docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
52- --build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \
53- --output type=docker --progress=plain \
59+ --build-arg HTTP_CLI_VERSION=$VERSION \
60+ --output type=registry --progress=plain \
5461 --secret id=github_token,src=github_token \
5562 --cache-from type=local,src=/tmp/.buildx-cache \
5663 --cache-to type=local,dest=/tmp/.buildx-cache \
57- -t lambda-shell-runtime:base -f base.Dockerfile .
64+ -t $IMAGE:base-$VERSION \
65+ -t $IMAGE:base-latest \
66+ -f base.Dockerfile .
5867
5968 docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
60- --build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \
61- --output type=docker --progress=plain \
69+ --build-arg HTTP_CLI_VERSION=$VERSION \
70+ --output type=registry --progress=plain \
6271 --secret id=github_token,src=github_token \
6372 --cache-from type=local,src=/tmp/.buildx-cache \
6473 --cache-to type=local,dest=/tmp/.buildx-cache \
65- -t lambda-shell-runtime:tiny -f tiny.Dockerfile .
74+ -t $IMAGE:tiny-$VERSION \
75+ -t $IMAGE:tiny-latest \
76+ -f tiny.Dockerfile .
6677
6778 docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
68- --build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \
69- --output type=docker --progress=plain \
79+ --build-arg HTTP_CLI_VERSION=$VERSION \
80+ --output type=registry --progress=plain \
7081 --secret id=github_token,src=github_token \
7182 --cache-from type=local,src=/tmp/.buildx-cache \
7283 --cache-to type=local,dest=/tmp/.buildx-cache \
73- -t lambda-shell-runtime:micro -f micro.Dockerfile .
84+ -t $IMAGE:micro-$VERSION \
85+ -t $IMAGE:micro-latest \
86+ -f micro.Dockerfile .
7487
7588 docker buildx build --builder shell-runtime-builder --platform linux/arm64 \
76- --build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \
77- --output type=docker --progress=plain \
89+ --build-arg HTTP_CLI_VERSION=$VERSION \
90+ --output type=registry --progress=plain \
7891 --secret id=github_token,src=github_token \
7992 --cache-from type=local,src=/tmp/.buildx-cache \
8093 --cache-to type=local,dest=/tmp/.buildx-cache \
81- -t lambda-shell-runtime:full -f Dockerfile .
94+ -t $IMAGE:full-$VERSION \
95+ -t $IMAGE:full-latest \
96+ -f Dockerfile .
8297 shell : bash
8398 - name : Log in to GHCR
8499 run : echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u skunxicat --password-stdin
0 commit comments