Skip to content

Commit

Permalink
Merge pull request #188 from privacy-scaling-explorations/staging
Browse files Browse the repository at this point in the history
chore (release) - Release 1.0.9
  • Loading branch information
ctrlc03 authored Oct 20, 2023
2 parents a50a645 + 824e691 commit bf3a814
Show file tree
Hide file tree
Showing 52 changed files with 944 additions and 797 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy-and-test-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ concurrency:
cancel-in-progress: true

jobs:

deploy-dev:
uses: ./.github/workflows/firebase-deploy.yaml
uses: ./.github/workflows/firebase-deploy-dev.yaml
secrets: inherit
with:
environment: dev
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ concurrency:
cancel-in-progress: true

jobs:

deploy-production:
uses: ./.github/workflows/firebase-deploy.yaml
uses: ./.github/workflows/firebase-deploy-production.yaml
secrets: inherit
with:
environment: production
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
deploy-staging:
uses: ./.github/workflows/firebase-deploy.yaml
uses: ./.github/workflows/firebase-deploy-staging.yaml
secrets: inherit
with:
environment: staging
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/firebase-deploy-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deploy to Firebase Dev Environment

on:
workflow_call:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string

environment:
description: "Environment to deploy to"
required: true
type: string

firebase_project:
description: "The name of the Firebase project to deploy to"
required: true
type: string

jobs:
deploy-p0tion:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"

- name: Update package.json dependencies and names
run: |
# Enable recursive globbing
shopt -s globstar
# Update package.json dependencies
sed -i -e 's/"@p0tion\/actions": "[^"]*"/"@devtion\/actions": "latest"/g' ./packages/backend/package.json
# Update string literals in TypeScript files
sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.ts
cat ./packages/backend/package.json
cat ./packages/backend/src/functions/ceremony.ts
- name: Install npm packages and write env
run: |
yarn install
echo "${{ secrets.ACTIONS_ENV_FILE }}" > ./packages/actions/.env
echo "${{ secrets.BACKEND_ENV_FILE }}" > ./packages/backend/.env
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: "false"

- name: build packages
run: yarn build
env:
NODE_OPTIONS: "--max_old_space_size=4096"

# Workaround for SSL error. (resource: https://github.com/firebase/firebase-admin-node/issues/1712)
- name: SSL Workaround
run: sudo sed -i '54 s/^/#/' /usr/lib/ssl/openssl.cnf

- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only functions --project ${{ inputs.firebase_project }}
env:
GCP_SA_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }}
PROJECT_PATH: ./packages/backend
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
name: Deploy to Firebase
name: Deploy to Firebase Production Environment

on:
workflow_call:
inputs:
branch:
description: 'Branch to deploy'
description: "Branch to deploy"
required: true
type: string

environment:
description: 'Environment to deploy to'
description: "Environment to deploy to"
required: true
type: string

firebase_project:
description: 'The name of the Firebase project to deploy to'
description: "The name of the Firebase project to deploy to"
required: true
type: string


jobs:
deploy-p0tion:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:

- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
Expand All @@ -37,7 +35,7 @@ jobs:

- name: Install npm packages and write env
run: |
yarn install --immutable
yarn install
echo "${{ secrets.ACTIONS_ENV_FILE }}" > ./packages/actions/.env
echo "${{ secrets.BACKEND_ENV_FILE }}" > ./packages/backend/.env
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/firebase-deploy-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy to Firebase Staging Environment

on:
workflow_call:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string

environment:
description: "Environment to deploy to"
required: true
type: string

firebase_project:
description: "The name of the Firebase project to deploy to"
required: true
type: string

jobs:
deploy-p0tion:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"

- name: Update package.json dependencies and names
run: |
# Enable recursive globbing
shopt -s globstar
# Update package.json dependencies
sed -i -e 's/"@p0tion\/actions": "[^"]*"/"@stagtion\/actions": "latest"/g' ./packages/backend/package.json
# Update string literals in TypeScript files
sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.ts
- name: Install npm packages and write env
run: |
yarn install
echo "${{ secrets.ACTIONS_ENV_FILE }}" > ./packages/actions/.env
echo "${{ secrets.BACKEND_ENV_FILE }}" > ./packages/backend/.env
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: "false"

- name: build packages
run: yarn build
env:
NODE_OPTIONS: "--max_old_space_size=4096"

# Workaround for SSL error. (resource: https://github.com/firebase/firebase-admin-node/issues/1712)
- name: SSL Workaround
run: sudo sed -i '54 s/^/#/' /usr/lib/ssl/openssl.cnf

- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only functions --project ${{ inputs.firebase_project }}
env:
GCP_SA_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }}
PROJECT_PATH: ./packages/backend
8 changes: 3 additions & 5 deletions .github/workflows/firebase-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,25 @@ on:
workflow_call:
inputs:
github_ref:
description: 'The branch or tag ref that triggered the workflow'
description: "The branch or tag ref that triggered the workflow"
required: true
type: string

environment:
description: 'Environment to deploy to'
description: "Environment to deploy to"
required: true
type: string

firebase_project:
description: 'The name of the Firebase project to test'
description: "The name of the Firebase project to test"
required: true
type: string


jobs:
test-p0tion:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:

- uses: actions/checkout@v3
with:
ref: ${{ inputs.github_ref }}
Expand Down
Loading

0 comments on commit bf3a814

Please sign in to comment.