From 6fd2550f00c346bbf9904dc9329f7b54ca733d39 Mon Sep 17 00:00:00 2001 From: Jonas Schell Date: Fri, 13 Sep 2024 12:10:20 +0200 Subject: [PATCH] Add GitHub workflow for syncing main to sandbox-production (#327) --- .github/workflows/sync-to-production.yaml | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/sync-to-production.yaml diff --git a/.github/workflows/sync-to-production.yaml b/.github/workflows/sync-to-production.yaml new file mode 100644 index 0000000..0ec1e4e --- /dev/null +++ b/.github/workflows/sync-to-production.yaml @@ -0,0 +1,33 @@ +name: Sync main to sandbox-production + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + 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