-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.78 KB
/
Copy pathdeploy.yml
File metadata and controls
55 lines (50 loc) · 1.78 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
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
# npm run check の中で本番ビルドまで走る。Googleドライブ同期の
# OAuth クライアントIDは、そのビルドのときに埋めこむ。
#
# リポジトリの Settings > Secrets and variables > Actions > Variables に
# VITE_GOOGLE_CLIENT_ID を登録すると、先生が画面で設定しなくても
# 「Googleでログインして接続」だけで使えるようになる。
# 未登録でもビルドは通り、同期の欄だけが使えない表示になる。
# 設定のしかたは GOOGLE_DRIVE_SETUP.md にある。
#
# ⚠️ Variables(変数)に置く。Secrets(秘密)ではない。
# Web 向けの OAuth クライアントIDは、どのみち配信物とブラウザの通信に
# 出てくる公開の識別子で、隠しても意味がない。Secrets に入れると
# ログで伏字になり、埋めこみを目で確かめられなくなるほうが困る。
- run: npm run check
env:
VITE_GOOGLE_CLIENT_ID: ${{ vars.VITE_GOOGLE_CLIENT_ID }}
- uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4