51 lines
1.6 KiB
YAML
Raw Normal View History

2022-03-04 23:49:00 +08:00
name: build
2022-03-01 01:04:07 +08:00
on:
push:
2022-03-01 15:15:52 +08:00
branches: [ master ]
2022-03-01 01:04:07 +08:00
workflow_dispatch:
jobs:
2022-03-01 02:11:59 +08:00
Rebuild-everything:
2022-03-01 01:04:07 +08:00
runs-on: ubuntu-latest
steps:
2022-03-05 01:20:47 +08:00
# Checkout, install tools..
2022-03-01 01:04:07 +08:00
- uses: actions/checkout@v2
2022-03-05 00:29:01 +08:00
with:
token: ${{ secrets.PAT }}
2022-03-01 01:04:07 +08:00
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install packages
run: sudo gem install mdl
2022-03-05 01:31:49 +08:00
# Generate Readme, mkdocs.
- run: node ./.github/readme-generate.js
2022-03-05 01:20:47 +08:00
# Lint issues first. (Without node_modules)
- name: Lint markdown files
2022-05-13 01:09:13 +08:00
run: mdl . -r ~MD036,~MD024,~MD004,~MD029,~MD013
- run: pip install -r requirements.txt
- run: mkdocs build --strict
2022-03-01 01:42:13 +08:00
# Do textlint fix.
2022-03-05 01:20:47 +08:00
- run: npm install
2022-03-01 01:04:07 +08:00
- run: ./node_modules/.bin/textlint . --fix
2022-03-05 01:20:47 +08:00
- run: rm ./node_modules -rvf
2022-03-01 01:42:13 +08:00
# Save files.
2022-03-01 01:04:07 +08:00
- uses: stefanzweifel/git-auto-commit-action@v4
with:
2022-03-01 01:42:13 +08:00
commit_message: '[ci skip] Automatic file changes/fix'
2022-03-01 01:04:07 +08:00
branch: 'master'
2022-03-05 00:36:13 +08:00
file_pattern: ':/*.*'
2022-03-01 01:04:07 +08:00
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>
2022-03-01 01:42:13 +08:00
# Build docs
2022-03-01 15:27:58 +08:00
- run: echo cook.aiurs.co > CNAME
2022-03-01 02:16:57 +08:00
- run: mkdir docs && echo cook.aiurs.co > docs/CNAME
2022-03-01 01:45:53 +08:00
- 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