docs.yml
· 1.5 KiB · YAML
Raw
name: Documentation
on:
push:
branches:
- docs
paths:
- 'docs_zh/**'
- 'zensical.toml'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- run: pip install zensical
- run: zensical build --clean
### SSH Server WEB
- name: Set up SSH
uses: LuisEnMarroquin/[email protected]
with:
ORIGIN: ${{ secrets.SSH_HOSTNAME }}
SSHKEY: ${{ secrets.SSH_KEY }}
NAME: webserver
PORT: ${{ secrets.SSH_PORT }}
USER: ${{ secrets.SSH_USERNAME }}
- run: echo "" >> ~/.ssh/access # fix
- name: Deploy the website
env:
WEBROOT: /data/wwwroot/ferron
run: |
ssh webserver "rm -rf $WEBROOT && mkdir -p $WEBROOT"
scp -r site/* webserver:${WEBROOT}
### GitHub Pages
- run: cp CNAME site/
- uses: actions/upload-pages-artifact@v4
with:
path: site
- uses: actions/deploy-pages@v4
id: deployment
- name: Deploy to Branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
| 1 | name: Documentation |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - docs |
| 7 | paths: |
| 8 | - 'docs_zh/**' |
| 9 | - 'zensical.toml' |
| 10 | - '.github/workflows/docs.yml' |
| 11 | |
| 12 | workflow_dispatch: |
| 13 | |
| 14 | permissions: |
| 15 | contents: write |
| 16 | pages: write |
| 17 | id-token: write |
| 18 | |
| 19 | jobs: |
| 20 | deploy: |
| 21 | environment: |
| 22 | name: github-pages |
| 23 | url: ${{ steps.deployment.outputs.page_url }} |
| 24 | runs-on: ubuntu-latest |
| 25 | steps: |
| 26 | - uses: actions/configure-pages@v5 |
| 27 | - uses: actions/checkout@v6 |
| 28 | - uses: actions/setup-python@v6 |
| 29 | with: |
| 30 | python-version: 3.x |
| 31 | - run: pip install zensical |
| 32 | - run: zensical build --clean |
| 33 | |
| 34 | ### SSH Server WEB |
| 35 | - name: Set up SSH |
| 36 | uses: LuisEnMarroquin/[email protected] |
| 37 | with: |
| 38 | ORIGIN: ${{ secrets.SSH_HOSTNAME }} |
| 39 | SSHKEY: ${{ secrets.SSH_KEY }} |
| 40 | NAME: webserver |
| 41 | PORT: ${{ secrets.SSH_PORT }} |
| 42 | USER: ${{ secrets.SSH_USERNAME }} |
| 43 | - run: echo "" >> ~/.ssh/access # fix |
| 44 | - name: Deploy the website |
| 45 | env: |
| 46 | WEBROOT: /data/wwwroot/ferron |
| 47 | run: | |
| 48 | ssh webserver "rm -rf $WEBROOT && mkdir -p $WEBROOT" |
| 49 | scp -r site/* webserver:${WEBROOT} |
| 50 | |
| 51 | ### GitHub Pages |
| 52 | - run: cp CNAME site/ |
| 53 | - uses: actions/upload-pages-artifact@v4 |
| 54 | with: |
| 55 | path: site |
| 56 | - uses: actions/deploy-pages@v4 |
| 57 | id: deployment |
| 58 | |
| 59 | - name: Deploy to Branch |
| 60 | uses: peaceiris/actions-gh-pages@v3 |
| 61 | with: |
| 62 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 63 | publish_dir: ./site |
| 64 |