-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (94 loc) · 3.21 KB
/
pr-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: PR build
on:
pull_request:
types: [ opened, synchronize, reopened ]
paths-ignore:
- "LICENSE"
- "CODEOWNERS"
branches:
- "main"
jobs:
cancel-previous-workflows:
name: Cancel previous workflows
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
# https://github.com/styfle/cancel-workflow-action#advanced-token-permissions
permissions:
actions: write
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
documentation-sanity:
name: Check documentation
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run LanguageTool
uses: reviewdog/action-languagetool@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: info
patterns: "**.md"
custom_api_endpoint: ''
### Flags for LanguageTool ###
# Ref: https://languagetool.org/http-api/swagger-ui/#!/default/post_check
language: 'en-US'
enabled_rules: ''
disabled_rules: 'WHITESPACE_RULE,EN_QUOTES,DASH_RULE,WORD_CONTAINS_UNDERSCORE,UPPERCASE_SENTENCE_START,ARROWS,COMMA_PARENTHESIS_WHITESPACE,UNLIKELY_OPENING_PUNCTUATION,SENTENCE_WHITESPACE,CURRENCY,EN_UNPAIRED_BRACKETS,PHRASE_REPETITION,PUNCTUATION_PARAGRAPH_END,METRIC_UNITS_EN_US,ENGLISH_WORD_REPEAT_BEGINNING_RULE,DOUBLE_PUNCTUATION'
enabled_categories: ''
disabled_categories: 'TYPOS,TYPOGRAPHY,CASING'
enabled_only: 'false'
- name: Run misspell check
uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
pattern: "**.md"
level: info
locale: "US"
- name: Check links in *.mdx files
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
file-extension: '.mdx'
base-branch: 'main'
config-file: '.mlc.config.json'
check-modified-files-only: 'yes'
folder-path: 'docs, blog, community'
- name: Check links in *.md files
if: always() # validate also *.md even if errors found in mdx files.
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
file-extension: '.md'
check-modified-files-only: 'yes'
config-file: '.mlc.config.json'
folder-path: 'docs, blog, community'
base-branch: 'main'
build:
name: Lint and build website
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '17.x'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint code
run: npm run lint
- name: Build website
run: npm run build