Skip to content

Commit 1087275

Browse files
committed
chore: add Netlify configuration and deployment workflow for documentation
1 parent b1decd7 commit 1087275

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Documentation to Netlify
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
workflow_dispatch: # Allow manual triggering
9+
10+
jobs:
11+
deploy-docs:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # Fetch full history for proper git info
19+
20+
- name: Setup
21+
uses: ./.github/actions/setup
22+
23+
- name: Build documentation
24+
run: yarn docs
25+
26+
- name: Deploy to Netlify
27+
uses: nwtgck/actions-netlify@v3.0
28+
with:
29+
publish-dir: "./docs"
30+
production-branch: master
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
deploy-message: "Deploy docs from commit ${{ github.sha }}"
33+
enable-pull-request-comment: false
34+
enable-commit-comment: true
35+
overwrites-pull-request-comment: true
36+
env:
37+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
38+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ android/generated
8989
.xcode.env.local
9090
coverage/
9191
docs/
92+
93+
# Local Netlify folder
94+
.netlify

netlify.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[build]
2+
# This is the directory that will be deployed to Netlify
3+
publish = "docs"
4+
5+
# Build command (not needed since we build in GitHub Actions)
6+
command = "yarn docs"
7+
8+
[build.environment]
9+
NODE_VERSION = "20"
10+
11+
# Redirect rules for better documentation navigation
12+
[[redirects]]
13+
from = "/"
14+
to = "/index.html"
15+
status = 200
16+
17+
# Cache static assets
18+
[[headers]]
19+
for = "/*.js"
20+
[headers.values]
21+
Cache-Control = "public, max-age=31536000, immutable"
22+
23+
[[headers]]
24+
for = "/*.css"
25+
[headers.values]
26+
Cache-Control = "public, max-age=31536000, immutable"
27+
28+
[[headers]]
29+
for = "/*.png"
30+
[headers.values]
31+
Cache-Control = "public, max-age=31536000, immutable"
32+
33+
[[headers]]
34+
for = "/*.svg"
35+
[headers.values]
36+
Cache-Control = "public, max-age=31536000, immutable"
37+
38+
# Security headers
39+
[[headers]]
40+
for = "/*"
41+
[headers.values]
42+
X-Frame-Options = "DENY"
43+
X-XSS-Protection = "1; mode=block"
44+
X-Content-Type-Options = "nosniff"
45+
Referrer-Policy = "strict-origin-when-cross-origin"

0 commit comments

Comments
 (0)