-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.55 KB
/
deploy-merge.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
# https://github.com/google-github-actions/deploy-cloud-functions
name: Deploy to Cloud Functions and Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
concurrency: build_and_deploy
env:
NEXT_TELEMETRY_DISABLED: 1 # https://nextjs.org/telemetry
steps:
- uses: actions/checkout@v2
with:
submodules: true
ssh-key: '${{ secrets.ARCHIVES_DEPLOY_KEY }}'
- uses: actions/cache@v2
# https://nextjs.org/docs/messages/no-cache#github-actions
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: npm ci && npm run build && npm run export
- run: npm ci && npm run build
working-directory: ./functions
- uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HIDEO54 }}'
- uses: 'google-github-actions/deploy-cloud-functions@v2'
with:
name: hatenaStars
runtime: nodejs20
region: asia-northeast1
source_dir: functions
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HIDEO54 }}'
channelId: live
projectId: hideo54