-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·63 lines (61 loc) · 2.02 KB
/
build_and_deploy.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
name: Build and Deploy
on:
workflow_dispatch:
repository_dispatch:
push:
branches:
- main # only main
jobs:
build:
name: Build and Deploy
runs-on: ubuntu-latest
env:
BASIC_AUTH_USER: ${{ secrets.BASIC_AUTH_USER }}
BASIC_AUTH_PASSWORD: ${{ secrets.BASIC_AUTH_PASSWORD }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Checkout output in data repo
uses: actions/checkout@v3
with:
repository: core-curriculum/data
token: ${{ steps.app-token.outputs.token }}
path: data_in_repo
fetch-depth: 1
- name: Checkout output in json repo
uses: actions/checkout@v3
with:
repository: core-curriculum/json
token: ${{ steps.app-token.outputs.token }}
path: json_in_repo
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Compile and build
shell: bash
run: |
yarn install
yarn run build
- uses: amondnet/vercel-action@v20
with:
# GitHub Actions の Secrets で作成した値を参照する形で
# Vercel デプロイ時に必要となる各種パラメタを設定する
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
vercel-args: "--prod" # Optional
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required
working-directory: ./