-
Notifications
You must be signed in to change notification settings - Fork 38
95 lines (92 loc) · 2.89 KB
/
Copy pathci.yml
File metadata and controls
95 lines (92 loc) · 2.89 KB
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
name: ci
on: [push, pull_request]
permissions:
actions: read
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/yarn/v6
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: COLOR=1 ./make.sh
env:
GITHUB_TOKEN: ${{ github.token }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
DOCUSAURUS_IGNORE_SSG_WARNINGS: true
nofixups:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git submodule update --init
- run: COLOR=1 ./ci/sub/bin/nofixups.sh
env:
GITHUB_TOKEN: ${{ github.token }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
spell-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install cspell
run: npm install -g cspell
- name: Run spell check
run: |
ERRORS=$(cspell "**/*.md" --config .cspell.json --no-exit-code --quiet | grep 'fix:' || true)
if [ -n "$ERRORS" ]; then
echo "Spelling errors found:"
echo "$ERRORS"
exit 1
else
echo "No spelling errors found"
fi
alt-tags-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for missing alt attributes
run: ./scripts/check-alt-tags.sh
webp-versions-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for missing WebP versions
run: ./ci/check-webp-versions.sh
deploy:
needs: [ci, nofixups, spell-check, alt-tags-check, webp-versions-check]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
permissions:
contents: read
id-token: write
env:
D2_DOCS_S3_BUCKET: s3://d2lang-docs-278852893615
D2_DOCS_CLOUDFRONT_ID: E2NLB7I775SAF
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/cache@v3
with:
path: ~/.cache/yarn/v6
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::278852893615:role/d2lang-docs-deploy
aws-region: us-west-1
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Deploy to production
run: ./ci/deploy.sh
env:
D2_DOCS_ALGOLIA_CRAWLER_API_KEY: ${{ secrets.D2_DOCS_ALGOLIA_CRAWLER_API_KEY }}