.github/workflows/sync-docs-branch.yml
33 lines · 919 bytes
1# Action to automatically pull content of main branch into gh-pages
2# whenever main content is modified. Site will then be auto-deployed
3
4name: 🔄 Sync main to Website
5on:
6 workflow_dispatch: # Manual dispatch
7 schedule:
8 - cron: '0 5 * * 6' # Every Saturday morning.
9
10jobs:
11 copy-readme:
12 runs-on: ubuntu-latest
13 steps:
14 - name: Check out repo
15 uses: actions/checkout@v3
16 with:
17 fetch-depth: 0
18
19 - name: Configure git
20 run: |
21 git config --global user.email "alicia-gh-bot@mail.as93.net"
22 git config --global user.name "Liss-Bot"
23
24 - name: Copy README.md to gh-pages
25 run: |
26 git fetch
27 git checkout gh-pages
28 git checkout main -- .github/README.md
29 mv .github/README.md README.md
30 git add README.md
31 git commit -m "Update README.md from main"
32 git push origin gh-pages
33