2022-01-20 08:32:09 +00:00
|
|
|
name: Format + Docs Workflow
|
|
|
|
on:
|
|
|
|
push:
|
2022-01-21 17:19:56 +00:00
|
|
|
paths: ["docs/**", "**.md", "**.toml", "**.js", "**.json", "**.ts"]
|
2022-01-20 08:32:09 +00:00
|
|
|
pull_request:
|
2022-01-21 17:19:56 +00:00
|
|
|
paths: ["docs/**", "**.md", "**.toml", "**.js", "**.json", "**.ts"]
|
2022-01-20 08:32:09 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Run the dprint code formatter for documentation
|
|
|
|
dprint:
|
|
|
|
name: Dprint [Docs Formatter]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup | Checkout
|
2024-01-07 02:05:37 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-01-20 08:32:09 +00:00
|
|
|
- name: Docs | Format
|
2023-02-20 02:51:14 +00:00
|
|
|
uses: dprint/check@v2.2
|
2022-01-21 16:26:13 +00:00
|
|
|
|
2022-06-15 21:30:30 +00:00
|
|
|
# Validate preset files
|
|
|
|
taplo:
|
|
|
|
name: Taplo [Preset schema validation]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup | Checkout
|
2024-01-07 02:05:37 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-06-15 21:30:30 +00:00
|
|
|
- name: Install | Taplo
|
2024-02-01 14:07:00 +00:00
|
|
|
run: cargo install --debug --locked --version 0.9.0 taplo-cli
|
2022-06-15 21:30:30 +00:00
|
|
|
- name: Presets | Validate with schema
|
2024-03-24 07:03:55 +00:00
|
|
|
run: taplo lint --schema "file://${GITHUB_WORKSPACE}/.github/config-schema.json" docs/public/presets/toml/*.toml
|
2022-06-15 21:30:30 +00:00
|
|
|
|
2022-01-21 16:26:13 +00:00
|
|
|
# If this is not a Crowdin PR, block changes to translated documentation
|
|
|
|
block-crowdin:
|
|
|
|
name: Block Translated Changes
|
|
|
|
runs-on: ubuntu-latest
|
2022-01-21 17:19:56 +00:00
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
2022-01-21 16:26:13 +00:00
|
|
|
steps:
|
|
|
|
- name: Prevent File Change
|
2024-01-17 20:17:17 +00:00
|
|
|
uses: xalvarez/prevent-file-change-action@v1.6.0
|
2022-01-25 08:56:07 +00:00
|
|
|
if: ${{ github.event.pull_request.head.ref != 'i18n_master' }}
|
2022-01-21 16:26:13 +00:00
|
|
|
with:
|
|
|
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
pattern: docs/[a-z][a-z][a-z]?-[A-Z][A-Z]?/.*
|
2024-03-03 16:55:30 +00:00
|
|
|
|
|
|
|
# Vitepress build
|
|
|
|
vitepress:
|
|
|
|
name: Vitepress [Build]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup | Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup | Node
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: docs/package-lock.json
|
|
|
|
|
|
|
|
- name: Setup | Install dependencies
|
|
|
|
run: npm install
|
|
|
|
working-directory: docs
|
|
|
|
|
|
|
|
- name: Build | Build docs site
|
|
|
|
run: npm run build
|
|
|
|
working-directory: docs
|