From 9cbcae9773409ebd7015babf1a281c478124da6b Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 18 Jun 2022 19:41:56 -0400 Subject: [PATCH] Attempt to make a syncing github action --- .github/workflows/sync-staging-branch.yml | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/sync-staging-branch.yml diff --git a/.github/workflows/sync-staging-branch.yml b/.github/workflows/sync-staging-branch.yml new file mode 100644 index 0000000000..06b7a9051f --- /dev/null +++ b/.github/workflows/sync-staging-branch.yml @@ -0,0 +1,26 @@ +# Adapted from: +# https://github.community/t/user-github-pages-site-auto-deploy-from-another-branch-on-push/17912/2 +on: + push: + branches: + - master + +jobs: + job1: + runs-on: [ubuntu-latest] + steps: + - name: checkout master branch # checkout master branch + uses: actions/checkout@v2 + with: + persist-credentials: false + - name: Sync master to staging + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git fetch master staging:staging + git commit -m "Syncing staging with master" + - name: Push changes #push files into master branch + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + force: true