-
Notifications
You must be signed in to change notification settings - Fork 7
38 lines (36 loc) · 1.06 KB
/
publish-docs.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
name: Publish Doc Site
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
environment: prod
if: github.repository_owner == 'ShaunLawrie'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Docs
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$docsProjectRoot = "./PwshSpectreConsole.Docs"
npm ci --prefix $docsProjectRoot
if ($LASTEXITCODE -ne 0) {
throw "Failed to install npm dependencies"
}
npm run build --prefix $docsProjectRoot
if ($LASTEXITCODE -ne 0) {
throw "Failed to run npm build"
}
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: "./PwshSpectreConsole.Docs/dist"
command: pages deploy . --project-name pwshspectreconsole --commit-dirty=true --branch=main