From dd2931b9173cc33e30a2f530877c8172f6b95e1a Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Tue, 25 Jul 2023 09:45:05 -0500 Subject: [PATCH] chore(actions): add update-main.yml --- .github/workflows/update-main.yml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/update-main.yml diff --git a/.github/workflows/update-main.yml b/.github/workflows/update-main.yml new file mode 100644 index 0000000..0c61459 --- /dev/null +++ b/.github/workflows/update-main.yml @@ -0,0 +1,48 @@ +# This worflow merges the develop branch into main. This triggers a Production +# deployment. + +name: Update main branch + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Check out develop + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: true + ref: develop + + - name: Setup Git user + uses: fregante/setup-git-user@v1 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + + - name: Check out main + uses: actions/checkout@v3 + with: + clean: false + fetch-depth: 0 + persist-credentials: false + ref: main + + - name: Sync branches + run: git merge origin/develop + + - run: npm ci + + # Push merge commit back to main and trigger downstream workflows + # https://github.community/t/push-from-action-does-not-trigger-subsequent-action/16854/2 + - uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tags: true + branch: main