HowToCook/.github/workflows/build.yml
2022-03-01 02:16:57 +08:00

49 lines
1.3 KiB
YAML

name: Rebuild project
on:
push:
branches:
- '*'
- '*/*'
- '**'
pull_request:
branches:
- '*'
- '*/*'
- '**'
workflow_dispatch:
jobs:
Rebuild-everything:
runs-on: ubuntu-latest
steps:
# Preparation.
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- run: npm install
# Generate Readme.
- run: node ./.github/readme-generate.js
# Do textlint fix.
- run: ./node_modules/.bin/textlint . --fix
# Save files.
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[ci skip] Automatic file changes/fix'
branch: 'master'
file_pattern: ':/*.md'
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: rm ./node_modules -rvf
- 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