changelog: Add 2024-01-14 #345
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |