From 58661409f8f0157be125e2d7d5bf1726794ffe88 Mon Sep 17 00:00:00 2001 From: ryuupendragon Date: Fri, 4 Jul 2025 23:18:38 +0530 Subject: [PATCH] Update WF with parse --- .gitea/workflows/docker-publish.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/docker-publish.yml b/.gitea/workflows/docker-publish.yml index b04c6b8..5f9433b 100644 --- a/.gitea/workflows/docker-publish.yml +++ b/.gitea/workflows/docker-publish.yml @@ -4,8 +4,8 @@ on: workflow_dispatch: push: branches: [ "main" ] - paths-ignore: - - '**/README.md' + paths: + - Dockerfile jobs: build: @@ -19,6 +19,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Parse Caddy version + id: version + run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -31,7 +35,7 @@ jobs: - name: Build and Push Docker images for all Container Registries uses: docker/build-push-action@v6 with: - tags: ${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}-${{matrix.config.arch}}, ${{ vars.DOCKERHUB_REPO }}:latest-${{matrix.config.arch}} + tags: ${{ vars.DOCKERHUB_REPO }}:$VERSION-${{matrix.config.arch}}, ${{ vars.DOCKERHUB_REPO }}:latest-${{matrix.config.arch}} file: Dockerfile push: true @@ -39,6 +43,13 @@ jobs: runs-on: ubuntu-latest needs: build steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Parse Caddy version + id: version + run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -48,8 +59,8 @@ jobs: - name: Create and push manifest images for pinned uses: Noelware/docker-manifest-action@v1 with: - inputs: ${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}-arm64,${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}-amd64 - tags: ${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }} + inputs: ${{ vars.DOCKERHUB_REPO }}:$VERSION-arm64,${{ vars.DOCKERHUB_REPO }}:$VERSION-amd64 + tags: ${{ vars.DOCKERHUB_REPO }}:$VERSION push: true - name: Create and push manifest images for latest