-
Notifications
You must be signed in to change notification settings - Fork 84
35 lines (34 loc) · 1.08 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Deploy docs to GitHub Pages
on:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: 'pip'
- run: |
echo "COMMIT_MSG=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- run: pip install -r requirements.txt
- run: mkdocs build
- name: Git push assets to "gh-pages" branch
run: |
cd site || exit 1
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b gh-pages
git add .
git commit -m "Deployed ${{ env.COMMIT_MSG }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin gh-pages