HowToCook/.github/workflows/build.yml
2022-03-05 01:20:47 +08:00

51 lines
1.6 KiB
YAML

name: build
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
Rebuild-everything:
runs-on: ubuntu-latest
steps:
# Checkout, install tools..
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install packages
run: sudo gem install mdl
# Lint issues first. (Without node_modules)
- name: Lint markdown files
run: mdl . -r ~MD036,~MD024,~MD004,~MD029
- run: pip install -r requirements.txt
- run: mkdocs build --strict
# Generate Readme, mkdocs.
- run: node ./.github/readme-generate.js
# Do textlint fix.
- run: npm install
- run: ./node_modules/.bin/textlint . --fix
- run: rm ./node_modules -rvf
# Save files.
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[ci skip] Automatic file changes/fix'
branch: 'master'
file_pattern: ':/*.*'
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
# 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