-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
101 lines (99 loc) · 3.27 KB
/
documentation.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
95
96
97
98
99
100
101
name: Documentation
on:
pull_request:
paths:
- "documentation/**"
- ".github/workflows/documentation.yml"
push:
paths:
- "documentation/**"
- ".github/workflows/documentation.yml"
branches:
- main
workflow_dispatch:
jobs:
typos:
name: Check spelling using typos
runs-on: ubuntu-latest
concurrency:
group: docs-typos-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out code.
uses: actions/checkout@v4
- name: typos
id: check_for_typos
uses: crate-ci/typos@master
with:
config: ./typos.toml
deploy_documentation:
name: Documentation Deploy
runs-on: ubuntu-latest
concurrency:
group: docs-deploy-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cat <<EOT >> ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa
EOT
- name: Install & build dependencies
run: pnpm install
- name: Install dependencies (Docs)
run: |
cd documentation
pnpm install
- name: Release to GitHub Pages
if: github.ref == 'refs/heads/main'
env:
USE_SSH: true
GIT_USER: pankod-bot
NODE_ENV: production
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
cd documentation
git config --global user.email "[email protected]"
git config --global user.name "pankod-bot"
LIVE_PREVIEW_URL=https://cloud2.refine.dev/.refine/preview pnpm run deploy
- name: Build Documentation
if: github.ref != 'refs/heads/main'
run: |
cd documentation
LIVE_PREVIEW_URL=https://cloud2.refine.dev/.refine/preview pnpm build
- name: Deploy to Netlify
if: github.ref != 'refs/heads/main'
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: "./documentation/build"
github-token: ${{ secrets.PANKOD_BOT_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: false
overwrites-pull-request-comment: false
github-deployment-environment: "deploy-preview-website-${{ github.event.number }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 15
- name: Check Existing Links in Documentation
if: ${{ github.ref != 'refs/heads/main' && steps.netlify-deploy.outputs.deploy-url }}
run: DEPLOY_URL=${{ steps.netlify-deploy.outputs.deploy-url }} SITEMAP_URL=https://refine.dev/sitemap.xml node ./.github/workflows/scripts/check-existing-doc-links.js