-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.5 KB
/
deploy.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
name: Deploy Documentation
on:
push:
branches:
- master
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache node_modules
id: cache-nodemodules
uses: actions/cache@v3
with:
path: docs/node_modules
key: ${{ runner.os }}-cache-docs-nodemodules-${{ hashFiles('docs/package-lock.json') }}
restore-keys: |
${{ runner.os }}-cache-docs-nodemodules-
- name: Install Dependencies if Cache Miss
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
cd docs
npm ci
echo "Listing node_modules as cache was not hit:"
ls -la node_modules
- name: Log node_modules Contents if Cache Hit
if: steps.cache-nodemodules.outputs.cache-hit == 'true'
run: |
echo "Cache was hit. Listing node_modules contents:"
ls -la docs/node_modules
echo "Checking for 'vike' package:"
ls -la docs/node_modules/.bin
npm ls vike
- name: Build Documentation
run: |
cd docs
npm run docs:publish
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/dist/client