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