-
Notifications
You must be signed in to change notification settings - Fork 22
120 lines (98 loc) · 2.87 KB
/
deploy-pages.yml
File metadata and controls
120 lines (98 loc) · 2.87 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
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Deploy Pages
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: "30 16 * * *"
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
env:
PUBLIC_BASE_PATH: ${{ vars.PUBLIC_BASE_PATH }}
PUBLIC_NOINDEX: ${{ vars.PUBLIC_NOINDEX || 'true' }}
jobs:
refresh-data:
if: github.actor != 'github-actions[bot]'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate vigotech data
run: pnpm generate:data
env:
EVENTBRITE_OAUTH_TOKEN: ${{ secrets.EVENTBRITE_OAUTH_TOKEN }}
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
- name: Sync Astro content types
run: pnpm astro sync
- name: Format generated content
run: pnpm format src/content/events src/content/videos
- name: Commit generated data
run: |
if git diff --quiet -- public/vigotech-generated.json src/content/videos src/content/events; then
echo "No generated changes to commit"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add public/vigotech-generated.json src/content/videos src/content/events
git commit -m "chore: refresh generated community history" --no-verify
git push
build:
needs: refresh-data
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate vigotech data
run: pnpm generate:data
env:
EVENTBRITE_OAUTH_TOKEN: ${{ secrets.EVENTBRITE_OAUTH_TOKEN }}
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
- name: Build site
run: pnpm build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5