File tree Expand file tree Collapse file tree 2 files changed +92
-0
lines changed
Expand file tree Collapse file tree 2 files changed +92
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to Netlify
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ build-and-deploy :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v4
16+
17+ - name : Setup Node.js
18+ uses : actions/setup-node@v4
19+ with :
20+ node-version : " 20.19.0"
21+ cache : " npm"
22+
23+ - name : Install dependencies
24+ run : npm ci
25+
26+ - name : Build project
27+ run : npm run build
28+ env :
29+ NODE_ENV : production
30+
31+ - name : Deploy to Netlify
32+ 33+ with :
34+ publish-dir : " ./dist"
35+ production-branch : main
36+ github-token : ${{ secrets.GITHUB_TOKEN }}
37+ deploy-message : " Deploy from GitHub Actions"
38+ enable-pull-request-comment : false
39+ enable-commit-comment : true
40+ overwrites-pull-request-comment : true
41+ env :
42+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
43+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
44+ timeout-minutes : 1
Original file line number Diff line number Diff line change 1+ # Netlify Configuration
2+ # For more information: https://docs.netlify.com/configure-builds/file-based-configuration/
3+
4+ [build ]
5+ publish = " dist"
6+ command = " npm run build"
7+
8+ # Redirect all requests to /index.html for SPA routing
9+ [[redirects ]]
10+ from = " /*"
11+ to = " /index.html"
12+ status = 200
13+
14+ # Serve admin page for Decap CMS
15+ [[redirects ]]
16+ from = " /admin"
17+ to = " /admin/index.html"
18+ status = 200
19+
20+ [[redirects ]]
21+ from = " /admin/*"
22+ to = " /admin/:splat"
23+ status = 200
24+
25+ # Cache static assets
26+ [[headers ]]
27+ for = " /assets/*"
28+ [headers .values ]
29+ Cache-Control = " public, max-age=31536000, immutable"
30+
31+ [[headers ]]
32+ for = " /*.js"
33+ [headers .values ]
34+ Cache-Control = " public, max-age=31536000, immutable"
35+
36+ [[headers ]]
37+ for = " /*.css"
38+ [headers .values ]
39+ Cache-Control = " public, max-age=31536000, immutable"
40+
41+ # Security headers
42+ [[headers ]]
43+ for = " /*"
44+ [headers .values ]
45+ X-Frame-Options = " DENY"
46+ X-Content-Type-Options = " nosniff"
47+ Referrer-Policy = " strict-origin-when-cross-origin"
48+ Permissions-Policy = " geolocation=(), microphone=(), camera=()"
You can’t perform that action at this time.
0 commit comments