Skip to content

Commit

Permalink
Fix: Version build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
vkartk committed May 30, 2024
1 parent 625a2c1 commit 3f2ac2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/build-docker-image-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
id: set_version
run: |
if [ -z "${{ github.event.client_payload.latest_version }}" ]; then
VERSION=$(cat version.json | jq -r '.version')
VERSION=$(cat version.json | jq -r '.version' | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "VERSION=${{ github.event.client_payload.latest_version }}" >> $GITHUB_ENV
VERSION=$(echo "${{ github.event.client_payload.latest_version }}" | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
fi
- name: Check Caddy version availability
Expand All @@ -59,27 +60,23 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile-alpine
file: Dockerfile.alpine
push: true
build-args: |
CADDY_VERSION=${{ env.VERSION }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
tags: |
ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare-alpine:${{ env.VERSION }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare-alpine:latest
ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare:${{ env.VERSION }}-alpine
ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare:alpine
${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare-alpine:${{ env.VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare-alpine:latest
${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare:${{ env.VERSION }}-alpine
${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare:alpine
- name: Clean up Docker images
run: |
docker rmi ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare-alpine:${{ env.VERSION }} || true
docker rmi ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare:${{ env.VERSION }}-alpine || true
docker rmi ${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare-alpine:${{ env.VERSION }} || true
docker rmi ghcr.io/${{ secrets.DOCKER_USERNAME }}/caddy-cloudflare:alpine || true
docker rmi ${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare:${{ env.VERSION }}-alpine || true
docker rmi ${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare:alpine || true
docker builder prune --force
- name: Create GitHub Release
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-docker-image-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
id: set_version
run: |
if [ -z "${{ github.event.client_payload.latest_version }}" ]; then
VERSION=$(cat version.json | jq -r '.version')
VERSION=$(cat version.json | jq -r '.version' | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "VERSION=${{ github.event.client_payload.latest_version }}" >> $GITHUB_ENV
VERSION=$(echo "${{ github.event.client_payload.latest_version }}" | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
fi
- name: Check Caddy version availability
Expand Down
File renamed without changes.

0 comments on commit 3f2ac2a

Please sign in to comment.