From fb7577e22975b5b02a4fd1097b0454ac33f559a8 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 13 Dec 2024 14:54:03 -0800 Subject: [PATCH] [Admin] Add auto-publish workflow (#954) --- .github/workflows/auto-publish.yml | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/auto-publish.yml diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml new file mode 100644 index 00000000..875e0ad8 --- /dev/null +++ b/.github/workflows/auto-publish.yml @@ -0,0 +1,40 @@ +name: auto-publish +run-name: Automatically publish snippets +on: + schedule: + - cron: '00 23 * * FRI' + - cron: '15 10 * * TUE' + - cron: '15 10 * * THU' +jobs: + auto-publish: + runs-on: ubuntu-latest + permissions: + contents: write + defaults: + run: + shell: bash + working-directory: ./ + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check out main + run: | + echo "Checking out main branch" + git config user.name github-actions + git config user.email github-actions@github.com + git checkout main + - name: Check out prod + run: | + echo "Checking out prod branch" + git checkout prod + - name: Merge from main into prod + run: | + echo "Merging from main to prod" + git merge main + - name: Push changes + run: | + echo "Pushing changes to prod branch" + git push origin prod +