Appendix: remove unneeded sudo & refine AUR #648
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 | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: | | |
pip3 install -r requirements.txt | |
npm install | |
- name: Markdown style check (prettier) | |
run: | | |
npm run check | |
- name: Build docs | |
run: | | |
mkdocs -v build | |
: > site/.nojekyll | |
echo -n '101.ustclug.org' > site/CNAME | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/master' | |
run: | | |
CINFO="$(git log -1 --pretty="%an: [%h] %s")" | |
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}" \ | |
-m "$CINFO" | |
git push | |
popd &>/dev/null |