-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (61 loc) · 1.72 KB
/
deploy.yml
File metadata and controls
77 lines (61 loc) · 1.72 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# filepath: .github/workflows/deploy.yml
name: Build and Deploy to GitHub Pages
on:
# Run daily at 5:00 AM NZST (17:00 UTC)
schedule:
- cron: '0 17 * * *'
# Run on push to main branch
push:
branches: [ main ]
# Allow manual trigger
workflow_dispatch:
# Sets permissions for GitHub Pages deployment
permissions:
contents: read
pages: write
id-token: write
actions: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Keep workflow alive
uses: silverstripe/gha-keepalive@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: |
echo "Installing build dependencies"
npm ci
- name: Build site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Building site for deployment"
npm run build
- name: Verify build output
run: |
echo "Verifying build output..."
ls -la dist/
echo "✅ Build verification complete"
- name: Setup GitHub Pages
uses: actions/configure-pages@v4
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4