From 4fa0e085748b60c389edaaebc37693247c937e1c Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 25 Jun 2025 12:07:12 +0800 Subject: [PATCH] update workflows --- .github/workflows/deploy-images-on-release.yml | 10 ++++++++++ .github/workflows/deploy-images.yml | 11 +++++++++++ .github/workflows/production-deploy.yml | 2 ++ 3 files changed, 23 insertions(+) diff --git a/.github/workflows/deploy-images-on-release.yml b/.github/workflows/deploy-images-on-release.yml index f1d0dd7ce..cf06f7840 100644 --- a/.github/workflows/deploy-images-on-release.yml +++ b/.github/workflows/deploy-images-on-release.yml @@ -11,6 +11,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Extract version from tag id: extract_tag run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" @@ -93,6 +96,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -119,12 +124,16 @@ jobs: platforms: linux/amd64,linux/arm64 labels: | org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate + build-args: | + VITE_APP_VERSION=${{ steps.extract_tag.outputs.version }} docker-build-and-push-server-mono: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Extract version id: extract_tag @@ -143,6 +152,7 @@ jobs: -t ghcr.io/bluewave-labs/checkmate-backend-mono:${{ steps.extract_tag.outputs.version }} \ -f ./docker/dist-mono/server.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ + --build-arg VITE_APP_VERSION=${{ steps.extract_tag.outputs.version }} \ . - name: Push Server Docker image diff --git a/.github/workflows/deploy-images.yml b/.github/workflows/deploy-images.yml index ccc2104bc..fa39fed85 100644 --- a/.github/workflows/deploy-images.yml +++ b/.github/workflows/deploy-images.yml @@ -10,6 +10,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Log in to GitHub Container Registry uses: docker/login-action@v3 @@ -89,6 +91,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -123,6 +127,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Log in to GitHub Container Registry uses: docker/login-action@v3 @@ -131,12 +137,17 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Get version + id: vars + run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: Build Server Docker image run: | docker build \ -t ghcr.io/bluewave-labs/checkmate-backend-mono:latest \ -f ./docker/dist-mono/server.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ + --build-arg VITE_APP_VERSION=${{ env.VERSION }} \ . - name: Push Server Docker image diff --git a/.github/workflows/production-deploy.yml b/.github/workflows/production-deploy.yml index 4275b4a00..7764c488b 100644 --- a/.github/workflows/production-deploy.yml +++ b/.github/workflows/production-deploy.yml @@ -10,6 +10,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Log in to GitHub Container Registry uses: docker/login-action@v3