-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (68 loc) · 2.18 KB
/
Copy pathdeploy.yml
File metadata and controls
77 lines (68 loc) · 2.18 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
# c/o https://andr.is-a.dev/me/blog/deploy-your-next-js-website-to-github-pages
name: Build and Deploy
on:
push:
branches: [main]
workflow_dispatch:
inputs:
commit_version:
description: 'Commit version to deploy (Git SHA)'
default: 'HEAD'
required: true
type: string
permissions:
contents: read
actions: write
id-token: write
pages: write # to deploy to Pages
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.9.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
env:
NOTION_SECRET: ${{ secrets.NOTION_SECRET }}
ARENA_UID: ${{ secrets.ARENA_UID }}
ARENA_SECRET: ${{ secrets.ARENA_SECRET }}
ARENA_PERSONAL_ACCESS_TOKEN: ${{ secrets.ARENA_PERSONAL_ACCESS_TOKEN }}
SUBSTACK_API_KEY: ${{ secrets.SUBSTACK_API_KEY }}
SUBSTACK_HANDLE: ${{ vars.SUBSTACK_HANDLE }}
NEXT_PUBLIC_BASE_PATH: ${{ vars.NEXT_PUBLIC_BASE_PATH }}
NODE_ENV: production
LOG_LEVEL: error
DEBUG: error
# Notion and Substack both sit behind Cloudflare, which blocks Actions
# runners. Build from the snapshot committed under data/ (refreshed with
# `npm run fetch-content` on a dev machine) and fail loudly if it's absent.
CONTENT_SOURCE: snapshot
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.commit_version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install --include=dev
- run: DEBUG=1 VERBOSE=1 npm run build
- run: npm run export
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./out
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4