-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.03 KB
/
build.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
name: Build website
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip3 install -U -r requirements.txt
- name: Build site
run: |
mkdocs build
: > site/.nojekyll
echo -n 'vlab.ibugone.com' > site/CNAME
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
run: |
# Clone and deploy
git clone --depth=1 --branch=gh-pages --single-branch --no-checkout \
"https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" test
mv test/.git site/.git && rmdir test/
pushd site/ &>/dev/null
git add -A
git -c user.name=GitHub -c [email protected] commit \
-m "Auto deploy from GitHub Actions build ${{ github.run_number }}"
git push
popd &>/dev/null