Skip to content

Commit 425b3f3

Browse files
committed
chore: add netlify docs release workflows
1 parent babdc27 commit 425b3f3

File tree

7 files changed

+14394
-30
lines changed

7 files changed

+14394
-30
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
inputs:
9+
environment:
10+
description: 'Deployment environment'
11+
required: false
12+
default: 'production'
13+
type: choice
14+
options:
15+
- production
16+
- preview
17+
18+
jobs:
19+
release-docs:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
- name: Install dependencies
26+
uses: flowexec/action@v1
27+
with:
28+
executable: 'install docs:'
29+
timeout: '5m'
30+
- name: Deploy to Netlify
31+
uses: flowexec/action@v1
32+
with:
33+
executable: 'deploy docs:netlify ${{ github.event.inputs.environment || 'production' }}'
34+
timeout: '5m'
35+
flow-version: 'main'
36+
secrets: |
37+
{
38+
"netlify-flow-site-id": "${{ secrets.NETLIFY_SITE_ID }}",
39+
"netlify-pat": "${{ secrets.NETLIFY_AUTH_TOKEN }}"
40+
}

.github/workflows/release.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,6 @@ on:
1111
required: true
1212

1313
jobs:
14-
release-docs:
15-
environment:
16-
name: github-pages
17-
url: ${{ steps.deployment.outputs.page_url }}
18-
runs-on: ubuntu-latest
19-
permissions:
20-
contents: read
21-
pages: write
22-
id-token: write
23-
steps:
24-
- uses: actions/checkout@v6
25-
with:
26-
fetch-depth: 0
27-
- name: Set up Go
28-
uses: actions/setup-go@v6
29-
with:
30-
go-version: "^1.25"
31-
- name: Generate docs
32-
run: |
33-
go run ./tools/docsgen/.
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v4
38-
with:
39-
path: 'docs/'
40-
- name: Deploy to GitHub Pages
41-
id: deployment
42-
uses: actions/deploy-pages@main
4314
release-binary:
4415
permissions:
4516
contents: write

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ executable_output.txt
3232
flow
3333
flow*.tar.gz
3434
dist/
35+
36+
# Local Netlify folder
37+
.netlify

docs/docs.flow

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
namespace: docs
22
imports:
3-
- package.json
3+
- package.json
4+
5+
executables:
6+
- verb: deploy
7+
name: netlify
8+
description: Generate, build, and deploy documentation to Netlify
9+
tags: [docs, deploy]
10+
exec:
11+
args:
12+
- envKey: ENVIRONMENT
13+
default: preview
14+
pos: 1
15+
required: false
16+
params:
17+
- envKey: NETLIFY_AUTH_TOKEN
18+
secretRef: netlify-pat
19+
- envKey: NETLIFY_SITE_ID
20+
secretRef: netlify-flow-site-id
21+
cmd: |
22+
if [ "${ENVIRONMENT}" = "production" ]; then
23+
npx netlify-cli deploy --dir=dist --prod
24+
else
25+
npx netlify-cli deploy --dir=dist
26+
fi

docs/netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build]
2+
build = "npm run build"
3+
publish = "dist"

0 commit comments

Comments
 (0)