diff --git a/.github/workflows/update-environments.yml b/.github/workflows/update-environments.yml index fc0a31e83..23c38fce0 100644 --- a/.github/workflows/update-environments.yml +++ b/.github/workflows/update-environments.yml @@ -1,3 +1,4 @@ +# Refer to docs/testing-env.md to learn more about deployments configuration. name: Update staging and production environments on: @@ -5,6 +6,7 @@ on: branches: - main - stage-live + workflow_dispatch: jobs: sync-main-to-stage-live: @@ -14,15 +16,34 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Open/update a PR from `main` to `stage-live` - id: pull - uses: tretuna/sync-branches@1.4.0 + id: pr + uses: tretuna/sync-branches@ea58ab6 # 1.4.0 with: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} FROM_BRANCH: "main" TO_BRANCH: "stage-live" - PULL_REQUEST_TITLE: "Update stage environments" + PULL_REQUEST_TITLE: "🪄 [QA] Update stage environments" PULL_REQUEST_BODY: "This is a pull request that upon merging will update stage environments with recent `main` changes." REVIEWERS: '["andreachapman"]' + - uses: studroid/label-pr-or-issue-action@ff48a93 # v1.0.1 + with: + pr-or-issue-number: ${{ steps.pr.outputs.PULL_REQUEST_NUMBER }} + label: "⚙️ deployment" + sync-stage-live-to-stage-fork: + if: github.ref == 'refs/heads/stage-live' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: '0' + - name: Sync `stage-fork` with `stage-live` + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + git checkout stage-fork + git merge origin/stage-live + git push origin stage-fork sync-stage-live-to-release: if: github.ref == 'refs/heads/stage-live' runs-on: ubuntu-latest @@ -30,12 +51,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Open/update a PR from `main` to `stage-live` - id: pull - uses: tretuna/sync-branches@1.4.0 + id: pr + uses: tretuna/sync-branches@ea58ab6 # 1.4.0 with: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} FROM_BRANCH: "stage-live" TO_BRANCH: "release" - PULL_REQUEST_TITLE: "Update release branch" + PULL_REQUEST_TITLE: "🚀 [QA] Update release environment" PULL_REQUEST_BODY: "This is a pull request that upon merging will update production environment with recent `stage-live` changes." REVIEWERS: '["andreachapman"]' + - uses: studroid/label-pr-or-issue-action@ff48a93 # v1.0.1 + with: + pr-or-issue-number: ${{ steps.pr.outputs.PULL_REQUEST_NUMBER }} + label: "⚙️ deployment"