Skip to content

Update build.yml

Update build.yml #15

Workflow file for this run

name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.10.14
- name: install python modules
run: pip install flake8 markdown pypinyin
- name: format code
run: flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
- name: generate information
run: |
python3 utils/genReadme.py
python3 utils/genIndex.py
- name: git config
run: |
git config --global user.name "heqin-zhu"
git config --global user.email "[email protected]"
- name: generate pages and push to gh-pages branch
env:
ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
run: |
cd docs
git init
git remote add origin [email protected]:USTC-Resource/USTC-Course.git
git add --all
export TZ='Asia/Shanghai'
git commit -m "Update webpages at `date +%Y-%m-%d,%H:%m` UTC+8"
git push -f "https://${ACCESS_TOKEN}@github.com/USTC-Resource/USTC-Course" master:gh-pages