-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 1.56 KB
/
deploy-docs.yml
File metadata and controls
60 lines (50 loc) · 1.56 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
name: Deploy Docs
on:
push:
branches: [main]
paths:
- 'website/**'
- 'functions/**'
- '.github/workflows/deploy-docs.yml'
tags-ignore:
- '**'
release:
types: [published]
permissions:
contents: read
concurrency:
group: pages-${{ github.event_name }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
with:
package_json_file: website/package.json
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: website/pnpm-lock.yaml
- name: Install dependencies
working-directory: website
run: pnpm install --frozen-lockfile
- name: Build
working-directory: website
run: pnpm run build
- name: Deploy preview
if: github.event_name == 'push'
working-directory: website
run: pnpm dlx wrangler@latest pages deploy out --project-name=harness-kit-docs --branch=preview
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy production
if: github.event_name == 'release'
working-directory: website
run: pnpm dlx wrangler@latest pages deploy out --project-name=harness-kit-docs --branch=main
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}