-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (90 loc) · 2.8 KB
/
docs.yml
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
name: docs
defaults:
run:
shell: bash
working-directory: docs
on:
workflow_dispatch: {}
push:
branches: [master]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-18.04
steps:
- name: Install Node 14
uses: actions/setup-node@v2
with:
node-version: '14.17'
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('docs/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn lint --max-warnings 0
- run: yarn danger ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if `docs/yarn.lock` has been changed
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
lock:
- 'docs/yarn.lock'
- name: Cache Next folder
if: steps.changes.outputs.lock == 'false'
uses: actions/cache@v2
with:
path: docs/.next/cache
key: docs-next-${{ hashFiles('docs/yarn.lock') }}-next-${{ hashFiles('docs/next.config.js') }}
- run: yarn export
timeout-minutes: 20
env:
USE_ESBUILD: 1
# TODO(cedric): If we have time, we should make sure all links are valid and connected to a proper header
# - name: lint links
# run: yarn lint-links --quiet
- name: test links (legacy)
run: |
yarn export-server &
while ! nc -z localhost 8000; do
sleep 1
done
yarn test-links http://127.0.0.1:8000
timeout-minutes: 1
- run: ./deploy.sh
if: ${{ github.event.ref == 'refs/heads/master' }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && github.event.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_docs }}
with:
channel: '#docs'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Docs