forked from block/goose
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 2.2 KB
/
deploy-docs-and-extensions.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
name: Deploy Docs & Extensions # (/documentation and /extensions-site)
on:
push:
branches:
- main
pull_request:
paths:
- 'documentation/**'
- 'extensions-site/**'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the branch
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Cache Node.js modules (documentation)
uses: actions/cache@v3
with:
path: ./documentation/node_modules
key: ${{ runner.os }}-documentation-${{ hashFiles('./documentation/package-lock.json') }}
restore-keys: |
${{ runner.os }}-documentation-
- name: Install dependencies and build docs
working-directory: ./documentation
env:
INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }}
INKEEP_INTEGRATION_ID: ${{ secrets.INKEEP_INTEGRATION_ID }}
INKEEP_ORG_ID: ${{ secrets.INKEEP_ORG_ID }}
run: |
npm install
npm run build
- name: Cache Node.js modules (extensions-site)
uses: actions/cache@v3
with:
path: ./extensions-site/node_modules
key: ${{ runner.os }}-extensions-${{ hashFiles('./extensions-site/package-lock.json') }}
restore-keys: |
${{ runner.os }}-extensions-
- name: Install dependencies and build extensions-site
working-directory: ./extensions-site
env:
VITE_BASENAME: "/goose/v1/extensions/" # Set the base URL here for the extensions site
run: |
npm install
npm run build
- name: Combine builds into one directory
run: |
mkdir combined-build
cp -r documentation/build/* combined-build/
mkdir -p combined-build/v1/extensions
cp -r extensions-site/build/client/* combined-build/v1/extensions/
- name: Deploy to /gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: combined-build