HowToCook/.github/workflows/build.yml

53 lines
1.5 KiB
YAML
Raw Normal View History

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:
2023-11-27 07:53:56 +00:00
permissions:
contents: write
2022-02-28 17:04:07 +00:00
jobs:
2022-02-28 18:11:59 +00:00
Rebuild-everything:
2022-02-28 17:04:07 +00:00
runs-on: ubuntu-latest
steps:
2023-11-27 07:53:56 +00:00
- name: Clone
uses: actions/checkout@v3
2022-03-04 16:29:01 +00:00
with:
2023-11-27 07:53:56 +00:00
persist-credentials: 'true'
2022-02-28 17:04:07 +00:00
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- 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)
- name: Lint markdown files
run: mdl . -r ~MD036,~MD024,~MD004,~MD029,~MD013,~MD007
- 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.
- 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
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