-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.75 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
58 lines (51 loc) · 1.75 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
name: Deploy ARC Docs
on:
push:
branches: [main]
paths:
- 'specs/**'
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: docs/package-lock.json
- run: npm ci
working-directory: docs
- run: npm run build
working-directory: docs
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
destination_dir: docs
- name: Register deployment URL
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
deployment_id=$(gh api repos/${{ github.repository }}/deployments \
--method POST \
--input - <<EOF
{"ref":"${{ github.sha }}","environment":"arc-docs","description":"ARC Docs deploy","auto_merge":false,"required_contexts":[]}
EOF
)
deployment_id=$(echo "$deployment_id" | jq -r '.id')
gh api repos/${{ github.repository }}/deployments/$deployment_id/statuses \
--method POST \
--input - <<EOF
{"state":"success","environment_url":"https://arc-framework.github.io/arc-platform/docs/","description":"ARC Docs is live"}
EOF
echo "### ARC Docs Deployed" >> $GITHUB_STEP_SUMMARY
echo "[https://arc-framework.github.io/arc-platform/docs/](https://arc-framework.github.io/arc-platform/docs/)" >> $GITHUB_STEP_SUMMARY