From e8d37721ca9b8541b859092e557a8d5bf3b8dea7 Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Tue, 2 Sep 2025 16:15:55 -0600 Subject: [PATCH 1/2] chore(ci): tag deployment versions --- .github/workflows/sync-to-production.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-to-production.yaml b/.github/workflows/sync-to-production.yaml index 408acb335..5e8dc0ac7 100644 --- a/.github/workflows/sync-to-production.yaml +++ b/.github/workflows/sync-to-production.yaml @@ -1,11 +1,8 @@ -# .github/workflows/sync-main-to-sandbox-production.yml +# .github/workflows/sync-to-production.yml name: Sync main to sandbox-production on: - # push: - # branches: - # - main workflow_dispatch: permissions: @@ -34,3 +31,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" From 2a9fc0ee2542d0998ddeb8174be73c3752f97a2c Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Mon, 8 Sep 2025 18:47:28 -0600 Subject: [PATCH 2/2] feat(ci): use shared deploy workflow --- .github/workflows/sync-to-production.yaml | 39 ++++------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/.github/workflows/sync-to-production.yaml b/.github/workflows/sync-to-production.yaml index 5e8dc0ac7..3922a1b9c 100644 --- a/.github/workflows/sync-to-production.yaml +++ b/.github/workflows/sync-to-production.yaml @@ -1,43 +1,16 @@ -# .github/workflows/sync-to-production.yml - +# .github/workflows/sync-to-production.yaml name: Sync main to sandbox-production on: workflow_dispatch: -permissions: - contents: write - pull-requests: write - jobs: sync: runs-on: ubuntu-latest - + permissions: + contents: write steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: livekit-examples/sandbox-deploy-action@v1 with: - fetch-depth: 0 # Fetch all history so we can force push - - - name: Set up Git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@livekit.io' - - - name: Sync to sandbox-production - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - 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" + production_branch: 'sandbox-production' + token: ${{ secrets.GITHUB_TOKEN }}