-
Notifications
You must be signed in to change notification settings - Fork 5
194 lines (180 loc) · 8.05 KB
/
pull.yml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: ' ▶️ Pull'
on:
pull_request:
branches:
- main
# # prerelease
# - canary
# - develop
types:
- opened
- synchronize
- reopened
- ready_for_review
# - converted_to_draft
concurrency:
group: pull-${{ github.ref }}-1
cancel-in-progress: true
env:
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GH_DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}
GH_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
NEXT_PUBLIC__FATHOM_SITE_ID: ${{ secrets.NEXT_PUBLIC__FATHOM_SITE_ID }}
NEXT_PUBLIC__SITE: ${{ vars.NEXT_PUBLIC__SITE }}
NEXT_TELEMETRY_DISABLED: ${{ vars.NEXT_TELEMETRY_DISABLED }}
NOTION__DATABASE__BLOG: ${{ secrets.NOTION__DATABASE__BLOG }}
NOTION__DATABASE__BOOKS: ${{ secrets.NOTION__DATABASE__BOOKS }}
NOTION__DATABASE__EPISODES: ${{ secrets.NOTION__DATABASE__EPISODES }}
NOTION__DATABASE__EVENTS: ${{ secrets.NOTION__DATABASE__EVENTS }}
NOTION__DATABASE__PAGES: ${{ secrets.NOTION__DATABASE__PAGES }}
NOTION__DATABASE__PEOPLE: ${{ secrets.NOTION__DATABASE__PEOPLE }}
NOTION__DATABASE__PODCASTS: ${{ secrets.NOTION__DATABASE__PODCASTS }}
NOTION__DATABASE__SHOWS: ${{ secrets.NOTION__DATABASE__SHOWS }}
NOTION__DATABASE__VENUES: ${{ secrets.NOTION__DATABASE__VENUES }}
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
OCTOKIT_TOKEN: ${{ secrets.OCTOKIT_TOKEN }}
OG_API_KEY: ${{ secrets.OG_API_KEY }}
PREVIEW_TOKEN: ${{ secrets.PREVIEW_TOKEN }}
REVALIDATE_TOKEN: ${{ secrets.REVALIDATE_TOKEN }}
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
VERCEL_ENV: ${{ vars.VERCEL_ENV }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
jobs:
pull:
name: '👷️ CI'
if: ${{ github.event.pull_request.draft == false && !contains(github.event.head_commit.message, '[skip ci]') }}
timeout-minutes: 20
runs-on: ubuntu-latest
env:
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GH_DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}
GH_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
NEXT_PUBLIC__FATHOM_SITE_ID: ${{ secrets.NEXT_PUBLIC__FATHOM_SITE_ID }}
NEXT_PUBLIC__SITE: ${{ vars.NEXT_PUBLIC__SITE }}
NEXT_TELEMETRY_DISABLED: ${{ vars.NEXT_TELEMETRY_DISABLED }}
NOTION__DATABASE__BLOG: ${{ secrets.NOTION__DATABASE__BLOG }}
NOTION__DATABASE__BOOKS: ${{ secrets.NOTION__DATABASE__BOOKS }}
NOTION__DATABASE__EPISODES: ${{ secrets.NOTION__DATABASE__EPISODES }}
NOTION__DATABASE__EVENTS: ${{ secrets.NOTION__DATABASE__EVENTS }}
NOTION__DATABASE__PAGES: ${{ secrets.NOTION__DATABASE__PAGES }}
NOTION__DATABASE__PEOPLE: ${{ secrets.NOTION__DATABASE__PEOPLE }}
NOTION__DATABASE__PODCASTS: ${{ secrets.NOTION__DATABASE__PODCASTS }}
NOTION__DATABASE__SHOWS: ${{ secrets.NOTION__DATABASE__SHOWS }}
NOTION__DATABASE__VENUES: ${{ secrets.NOTION__DATABASE__VENUES }}
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
OCTOKIT_TOKEN: ${{ secrets.OCTOKIT_TOKEN }}
OG_API_KEY: ${{ secrets.OG_API_KEY }}
PREVIEW_TOKEN: ${{ secrets.PREVIEW_TOKEN }}
REVALIDATE_TOKEN: ${{ secrets.REVALIDATE_TOKEN }}
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
VERCEL_ENV: ${{ vars.VERCEL_ENV }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
IS_ACTOR_VERIFIED: ${{ github.actor == 'jeromefitz' || github.actor == 'renovate[bot]' }}
steps:
- name: '🐙️ Checkout'
id: pull-checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 1
- name: '💽️ Init'
id: pull-init
uses: JeromeFitz/websites/.github/actions/init@main
- name: '📦 Install'
id: pull-install
uses: JeromeFitz/websites/.github/actions/install@main
- name: '🔺️ Cache (vercel)'
id: pull-cache-vercel
uses: JeromeFitz/websites/.github/actions/cache-turbo@main
with:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
VERCEL_ENV: ${{ vars.VERCEL_ENV }}
- name: '🚨️ Lint'
id: pull-lint
uses: JeromeFitz/websites/.github/actions/lint@main
with:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- name: '🧪 Test'
id: pull-test
uses: JeromeFitz/websites/.github/actions/test@main
with:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
WEBSITE: 'jeromefitzgerald.com'
# https://docs.github.com/en/actions/learn-github-actions/expressions
- name: '📛 Commit Message'
id: pull-commit-message
run: |
echo "message=$(git log --no-merges -1 --oneline)" >> $GITHUB_OUTPUT
- name: '🎭 E2E'
id: pull-e2e
if: ${{ contains(steps.pull-commit-message.outputs.message, '[b]') }}
uses: JeromeFitz/websites/.github/actions/e2e@main
with:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
VERCEL_ENV: ${{ vars.VERCEL_ENV }}
WEBSITE: 'jeromefitzgerald.com'
- name: '🛠️ Deploy (Config)'
id: pull-deploy-config
if: ${{ contains(steps.pull-commit-message.outputs.message, '[b]') }}
uses: actions/github-script@v7
with:
script: |
core.setOutput('ref', context.payload.pull_request.head.ref)
core.setOutput('repo', context.payload.pull_request.head.repo.full_name)
# @note(gh-actions)
# I believe we need to `save/cache@3` for `.turbo-cache`
# before this step. For some reason I think it is getting
# cleared out when we re-pull a Checkout
#
# Now issue here is without this re-pull of Checkout I believe
# we do not pass Vercel the info it needs to determine if
# it needs to run the full build again. We shall see.
#
#
#################################
# - name: '🐙️ Deploy (Checkout)'
# id: pull-deploy-checkout
# uses: actions/checkout@v4
# if: ${{ (env.IS_ACTOR_VERIFIED == 'true') && contains(steps.pull-commit-message.outputs.message, '[b]') }}
# with:
# ref: ${{ steps.pull-deploy-config.outputs.ref }}
# repository: ${{ steps.pull-deploy-config.outputs.repo }}
# fetch-depth: 1
- name: '🔺️ Deploy (Preview)'
id: pull-deploy-preview
if: ${{ (env.IS_ACTOR_VERIFIED == 'true') && contains(steps.pull-commit-message.outputs.message, '[b]') }}
uses: JeromeFitz/websites/.github/actions/deploy@main
with:
DEPLOY_PR_FROM_FORK: true
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
PRODUCTION: false
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}