Skip to content

Deploy

Deploy #916

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
push:
branches:
- 'main'
jobs:
deploy-auth-service:
name: Deploy services/auth
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- 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 }}
# contentful
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: op://k33-web-env/prod/contentful/SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_ACCESS_TOKEN: op://k33-web-env/prod/contentful/PREVIEW_ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_SECRET: op://k33-web-env/prod/contentful/PREVIEW_SECRET
NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT: op://k33-web-env/prod/contentful/ENVIRONMENT
NEXT_PUBLIC_CONTENTFUL_GRAPHQL_ENDPOINT: op://k33-web-env/prod/contentful/GRAPHQL_ENDPOINT
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_SPACE_ID: op://k33-web-env/prod/contentful/ARCHIVE_SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ARCHIVE_ACCESS_TOKEN
# firebase app settings
NEXT_PUBLIC_FIREBASE_API_KEY: op://k33-web-env/prod/firebase/API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: op://k33-web-env/prod/firebase/AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID: op://k33-web-env/prod/firebase/PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: op://k33-web-env/prod/firebase/STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: op://k33-web-env/prod/firebase/MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID: op://k33-web-env/prod/firebase/APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: op://k33-web-env/prod/firebase/MEASUREMENT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/prod/firebase/SERVICE_ACCOUNT
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/prod/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/prod/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/prod/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/prod/domain/API
- name: Install dependencies
run: pnpm install
- name: Build local dependencies
run: pnpm --dir packages/ui build
- name: export services/auth
run: pnpm --dir apps/auth export
- name: deploy services/auth
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: 'k33-auth'
deploy-research-app:
name: Deploy research
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- 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 }}
# contentful
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: op://k33-web-env/prod/contentful/SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_ACCESS_TOKEN: op://k33-web-env/prod/contentful/PREVIEW_ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_SECRET: op://k33-web-env/prod/contentful/PREVIEW_SECRET
NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT: op://k33-web-env/prod/contentful/ENVIRONMENT
NEXT_PUBLIC_CONTENTFUL_GRAPHQL_ENDPOINT: op://k33-web-env/prod/contentful/GRAPHQL_ENDPOINT
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_SPACE_ID: op://k33-web-env/prod/contentful/ARCHIVE_SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ARCHIVE_ACCESS_TOKEN
# firebase app settings
NEXT_PUBLIC_FIREBASE_API_KEY: op://k33-web-env/prod/firebase/API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: op://k33-web-env/prod/firebase/AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID: op://k33-web-env/prod/firebase/PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: op://k33-web-env/prod/firebase/STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: op://k33-web-env/prod/firebase/MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID: op://k33-web-env/prod/firebase/APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: op://k33-web-env/prod/firebase/MEASUREMENT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/prod/firebase/SERVICE_ACCOUNT
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/prod/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/prod/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/prod/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/prod/domain/API
#algolia
NEXT_PUBLIC_ALGOLIA_APP_ID: op://k33-web-env/prod/algolia/APP_ID
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: op://k33-web-env/prod/algolia/SEARCH_API_KEY
- name: Install dependencies
run: pnpm install
- name: Build local dependencies
run: pnpm --dir packages/ui build
- name: export research
run: pnpm --dir apps/research export
- name: deploy research
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: 'k33-research'
deploy-invest-app:
name: Deploy invest
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- 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 }}
# contentful
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: op://k33-web-env/prod/contentful/SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_ACCESS_TOKEN: op://k33-web-env/prod/contentful/PREVIEW_ACCESS_TOKEN
NEXT_PUBLIC_CONTENTFUL_PREVIEW_SECRET: op://k33-web-env/prod/contentful/PREVIEW_SECRET
NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT: op://k33-web-env/prod/contentful/ENVIRONMENT
NEXT_PUBLIC_CONTENTFUL_GRAPHQL_ENDPOINT: op://k33-web-env/prod/contentful/GRAPHQL_ENDPOINT
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_SPACE_ID: op://k33-web-env/prod/contentful/ARCHIVE_SPACE_ID
NEXT_PUBLIC_CONTENTFUL_ARCHIVE_ACCESS_TOKEN: op://k33-web-env/prod/contentful/ARCHIVE_ACCESS_TOKEN
# firebase app settings
NEXT_PUBLIC_FIREBASE_API_KEY: op://k33-web-env/prod/firebase/API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: op://k33-web-env/prod/firebase/AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID: op://k33-web-env/prod/firebase/PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: op://k33-web-env/prod/firebase/STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: op://k33-web-env/prod/firebase/MESSAGING_SENDER_ID
NEXT_PUBLIC_FIREBASE_APP_ID: op://k33-web-env/prod/firebase/APP_ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: op://k33-web-env/prod/firebase/MEASUREMENT_ID
FIREBASE_SERVICE_ACCOUNT: op://k33-web-env/prod/firebase/SERVICE_ACCOUNT
# google
NEXT_PUBLIC_GOOGLE_ID: op://k33-web-env/prod/google/ID
NEXT_PUBLIC_GOOGLE_SECRET: op://k33-web-env/prod/google/SECRET
# domains
NEXT_PUBLIC_WEB_DOMAIN: op://k33-web-env/prod/domain/WEB
NEXT_PUBLIC_API_DOMAIN: op://k33-web-env/prod/domain/API
- name: Install dependencies
run: pnpm install
- name: Build local dependencies
run: pnpm --dir packages/ui build
- name: export invest
run: pnpm --dir apps/invest export
- name: deploy invest
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ env.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
projectId: '${{ env.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
channelId: live
# removing target will deploy all targets defined in .firebaserc
target: 'k33-invest'