-
Notifications
You must be signed in to change notification settings - Fork 55
77 lines (65 loc) · 1.9 KB
/
Copy pathdocs.yml
File metadata and controls
77 lines (65 loc) · 1.9 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
name: Deploy Docs
on:
push:
branches: ["main"]
paths:
- ".github/workflows/docs.yml"
- "packages/docs/**"
pull_request:
types:
- opened
- reopened
- synchronize
- closed
branches: ["main"]
paths:
- ".github/workflows/docs.yml"
- "packages/docs/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
lfs: true
- name: Cache turbo build setup
id: cache-turbo
uses: actions/cache@v4
with:
path: |
.turbo
packages/docs/out
key: ${{ runner.os }}-turbo-docs-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-docs-
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Set preview base uri
if: github.event_name == 'pull_request'
run: |
echo "NEXT_PUBLIC_BASE_PATH=/pr-preview/pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Build docs
run: bun turbo build --filter=@getpochi/docs
- name: Deploy preview
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1
with:
source-dir: packages/docs/out
- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
clean-exclude: pr-preview/
force: false
folder: packages/docs/out