-
Notifications
You must be signed in to change notification settings - Fork 19
107 lines (87 loc) · 2.79 KB
/
Copy pathdeploy_site.yml
File metadata and controls
107 lines (87 loc) · 2.79 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Deploy Novella Site
on:
push:
branches: ["main"]
paths:
- "site/**"
- "README.md"
- "assets/screenshots_*.PNG"
- ".github/workflows/deploy_site.yml"
release:
types: [published]
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
permissions:
contents: read
deployments: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build-and-deploy:
name: Cloudflare Pages
runs-on: ubuntu-latest
env:
GITHUB_REPOSITORY: ${{ github.repository }}
SITE_URL: ${{ vars.SITE_URL || 'https://novella.celia.sh' }}
SITE_BASE_PATH: ${{ vars.SITE_BASE_PATH || '/' }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 1
lfs: false
- name: Restore Git LFS Cache
uses: actions/cache@v5
with:
path: .git/lfs/objects
key: lfs-site-${{ runner.os }}-${{ hashFiles('site/web/assets/**') }}
restore-keys: |
lfs-site-${{ runner.os }}-
- name: Pull Required Git LFS Files
run: |
git lfs install --local
git lfs pull --include="site/web/assets" --exclude=""
- name: Setup Dart
uses: dart-lang/setup-dart@v1
- name: Activate Jaspr CLI
run: |
dart pub global activate jaspr_cli
echo "$HOME/.pub-cache/bin" >> "$GITHUB_PATH"
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install CSS dependencies
working-directory: site
run: npm install
- name: Install site dependencies
working-directory: site
run: dart pub get
- name: Fetch GitHub release data
working-directory: site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dart run tool/fetch_site_data.dart
- name: Generate announcements index
working-directory: site
run: dart run tool/generate_announcements.dart
- name: Build CSS
working-directory: site
run: npx @tailwindcss/cli -i src/input.css -o web/styles.css --minify
- name: Build static site
working-directory: site
run: jaspr build --sitemap-domain "$SITE_URL"
- name: Finalize static fallback page
working-directory: site
run: dart run tool/finalize_static_site.dart
- name: Generate repository
working-directory: site
run: dart run tool/generate_repository.dart
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site/build/jaspr --project-name=${{ vars.CF_PAGES_PROJECT_NAME || 'novella' }}