From 733c1e044bca9d5076501a62ef99c0dbab820081 Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Tue, 2 Sep 2025 16:19:49 -0600 Subject: [PATCH] chore(ci): tag deployment versions --- .github/workflows/sync-to-production.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync-to-production.yaml b/.github/workflows/sync-to-production.yaml index 03acb19..592f09d 100644 --- a/.github/workflows/sync-to-production.yaml +++ b/.github/workflows/sync-to-production.yaml @@ -1,9 +1,7 @@ name: Sync main to sandbox-production on: - push: - branches: - - main + workflow_dispatch: permissions: contents: write @@ -31,3 +29,13 @@ jobs: git checkout sandbox-production || git checkout -b sandbox-production git merge --strategy-option theirs main git push origin sandbox-production + + - name: Tag the deployment + if: github.ref == 'refs/heads/main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Increment version from previous tag of format vX + VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//' | awk -F. -v OFS=. '{$NF++;print}') + git tag -a "v$VERSION" -m "Deploy v$VERSION to production" + git push origin "v$VERSION"