|
1 | | -name: Deploy documentation ⚙️ |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - paths: |
8 | | - - 'workshop/content/**' |
9 | | - |
10 | | -defaults: |
11 | | - run: |
12 | | - working-directory: workshop/content |
13 | | - |
14 | | -jobs: |
15 | | - build: |
16 | | - name: Build and Deploy Documentation |
17 | | - runs-on: ubuntu-latest |
18 | | - steps: |
19 | | - - uses: actions/checkout@v2 |
20 | | - - uses: actions/setup-python@v2 |
21 | | - with: |
22 | | - python-version: '3.x' |
23 | | - - name: Install requirements 📦 |
24 | | - run: | |
25 | | - python -m pip install --upgrade pip |
26 | | - pip install -r requirements.txt |
27 | | - - name: Deploy 📦 |
28 | | - run: mkdocs gh-deploy --strict --force --message 'update website via GitHub Actions' |
| 1 | +name: Deploy documentation ⚙️ |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - 'workshop/content/**' |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: Build and Deploy Documentation |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v6 |
| 16 | + - uses: actions/setup-python@v6 |
| 17 | + with: |
| 18 | + python-version: '3.x' |
| 19 | + - name: Install requirements 📦 |
| 20 | + run: | |
| 21 | + python -m pip install --upgrade pip |
| 22 | + pip install -r workshop/content/requirements.txt |
| 23 | + - name: Build site 📦 |
| 24 | + run: | |
| 25 | + zensical build --clean --strict |
| 26 | + mv site /tmp/ |
| 27 | + - name: checkout gh-pages branch |
| 28 | + uses: actions/checkout@master |
| 29 | + with: |
| 30 | + ref: gh-pages |
| 31 | + - name: Deploy to GitHub Pages 📦 |
| 32 | + run: | |
| 33 | + git checkout gh-pages |
| 34 | + git config --local user.email "action@github.com" |
| 35 | + git config --local user.name "GitHub Action" |
| 36 | + ls | grep -v ".nojekyll"| xargs rm -fr |
| 37 | + mv -f /tmp/site/* . |
| 38 | + git add . |
| 39 | + git commit -am "update website via GitHub Actions" |
| 40 | + git push |
0 commit comments