Repository navigation
112 lines (93 loc) · 3.19 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
112 lines (93 loc) · 3.19 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Deploy Docs
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- master
paths:
- ".github/workflows/deploy-docs.yml"
- "docs/**"
push:
branches:
- master
paths:
- ".github/workflows/deploy-docs.yml"
- "docs/**"
workflow_dispatch:
concurrency:
group: deploy-docs-${{ github.ref }}
cancel-in-progress: false
permissions: { }
jobs:
build:
name: Build docs
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubicloud-standard-2-ubuntu-2204
permissions:
contents: read
steps:
- name: Check out Acton repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
lfs: true
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Restore Bun cache
id: bun-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: &build-docs-bun-cache-paths |
~/.bun/install/cache
${{ github.workspace }}/docs/.next/cache
key: ${{ runner.os }}-${{ runner.arch }}-bun-docs-${{ hashFiles('docs/bun.lock') }}-${{ hashFiles('docs/**.[jt]s', 'docs/**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-bun-docs-${{ hashFiles('docs/bun.lock') }}-
- name: Install docs dependencies
working-directory: docs
run: bun ci
- name: Generated source
working-directory: docs
run: bun run generated-source
- name: Check docs formatting
working-directory: docs
run: bun run fmt:check
- name: Lint Check docs
working-directory: docs
run: bun run docs-lint
- name: Build docs
working-directory: docs
env:
NEXT_TELEMETRY_DISABLED: '1'
run: bun run build
- name: Save Bun cache
if: github.ref == 'refs/heads/master' && steps.bun-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: *build-docs-bun-cache-paths
key: ${{ steps.bun-cache.outputs.cache-primary-key }}
- name: Upload GitHub Pages artifact
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/out
deploy:
name: Deploy docs
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton'
needs: [ build ]
runs-on: ubicloud-standard-2-ubuntu-2204
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1