Use a new native way to commid and push. #502
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: [ master ] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
Rebuild-everything: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: 'true' | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install packages | |
run: sudo gem install mdl | |
# Generate Readme, mkdocs. | |
- run: node ./.github/readme-generate.js | |
# Lint issues first. (Without node_modules) | |
- name: Lint markdown files | |
run: mdl . -r ~MD036,~MD024,~MD004,~MD029,~MD013,~MD007 | |
- run: pip install -r requirements.txt | |
- run: mkdocs build --strict | |
# Do textlint fix. | |
- run: npm install | |
- run: ./node_modules/.bin/textlint . --fix | |
- run: rm ./node_modules -rvf | |
# Save files. | |
- name: Push changes | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
git add . | |
git commit -m "[ci skip] Automatic file changes/fix v2" | |
git push | |
# Build docs | |
- run: echo cook.aiurs.co > CNAME | |
- run: mkdir docs && echo cook.aiurs.co > docs/CNAME | |
- uses: mhausenblas/mkdocs-deploy-gh-pages@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CUSTOM_DOMAIN: cook.aiurs.co | |
CONFIG_FILE: mkdocs.yml | |
REQUIREMENTS: requirements.txt |