Deploy Platform #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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 }}' |