-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 2.2 KB
/
deploy-platform.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
name: Deploy Platform
on:
workflow_dispatch:
inputs:
target_env:
description: 'Target environment'
required: true
default: 'dev'
type: choice
options:
- 'dev'
- 'prod'
jobs:
deploy-webflow:
name: Deploy apps/platform
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: fetch webflow exported zip file
run: wget https://storage.googleapis.com/k33-${{ inputs.target_env }}_webflow_export/k33-web.webflow.zip
- name: unzip
run: unzip k33-web.webflow.zip -d apps/platform/out/
- name: add public files excluding hidden files
run: cp apps/platform/public/* apps/platform/out/
- name: Load secrets
uses: 1password/load-secrets-action@v1
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# firebase
FIREBASE_PROJECT_ID: op://k33-web-env/${{ inputs.target_env }}/firebase/PROJECT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/${{ inputs.target_env }}/firebase/SERVICE_ACCOUNT
FIREBASE_PLATFORM_TARGET: op://k33-web-env/${{ inputs.target_env }}/firebase/PLATFORM_TARGET
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/${{ inputs.target_env }}/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/${{ inputs.target_env }}/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/${{ inputs.target_env }}/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/${{ inputs.target_env }}/domain/API
- name: deploy apps/platform
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: '${{ env.FIREBASE_PLATFORM_TARGET }}'