Skip to content

Commit

Permalink
Ff-prod-prdeploys (#1598)
Browse files Browse the repository at this point in the history
* abstract deployments/triggers to separate files

* remove triggers and some code cleanup

* Release centrifuge-react and Fabric (#1600)

* Centrifuge App: Fix connecting single account (#1620)

* feat: implement oracle-v2 (#1558)

* Centrifuge App: Remove accrued interest from portfolio card (#1625)

* Moonbeam to demo (#1627)

* CentrifugeJS: Fix transactions (#1622)

* Centrifuge App: Tinlake assets (#1631)

* Centrifuge App: Multicall for Tinlake assets (#1634)

* Centrifuge App: Get all proxies (#1637)

* Create LICENSE (#1646)

* Update support email (#1645)

* Centrifuge App: Pending write-off and epoch changes (#1628)

* Show anamoy pool after chain upgrade (#1648)

* Centrifuge App: Portfolio asset allocation (#1641)

* Centrifuge App: Fix asset class (#1650)

* Centrifuge App: Fix asset detail when subquery is down (#1653)

* Centrifuge App: Fix asset class in pool table (#1652)

* Fix connection guard for evm wallets on cent pool (#1661)

* swap to goldsky subgraph (#1662)

* feat: composition table (#1623)

* Centrifuge App: Table redesign (#1663)

* Centrifuge App: Code splitting and cleaning up unused files (#1660)

* fix: fix trx bug (#1667)

* Centrifuge App: Prime overview page (#1659)

* CentrifugeApp: Portfolio transaction table (#1605)

* Centrifuge App: Liquidity pools investments (#1542)

* Centrifuge App: Fix investor transaction report (#1675)

* fix: safe auth (#1651)

* Centrifuge App: Fixes (#1673)

* fix: use new window (#1676)

* fix: use new window

* use query param

* fix data sharing agreement text

* genericize

* rename

* Centrifuge App: Fix getting loan NFT data (#1685)

* Centrifuge App: Fix formatting for investor transactions (#1686)

* Centrifuge App: Prime detail (#1684)

* CentrifugeJS: Fix query for domain routers (#1692)

* Fix closed asset handling (#1693)

* Centrifuge App: Fix env var (#1694)

* fix: portfolio column spacing (#1698)

* Centrifuge App: Restricted transfers (#1697)

* remove moonbean alpha

* debug commenting on PR

* update demo endpoints

---------

Co-authored-by: Onno Visser <[email protected]>
Co-authored-by: JP <[email protected]>
Co-authored-by: Jeroen <[email protected]>
Co-authored-by: Sophia <[email protected]>
Co-authored-by: Adam Stox <[email protected]>
  • Loading branch information
6 people authored Dec 5, 2023
1 parent acaae0a commit d2d1c7f
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 60 deletions.
4 changes: 0 additions & 4 deletions .github/actions/deploy-gfunction/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ inputs:
deploy_env:
description: env to deploy function to
required: false

checkout_path:
description: Folder with repository code
required: true

GWIP:
description: Google Workflow Identity provider
Expand Down
18 changes: 12 additions & 6 deletions .github/actions/prepare-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,28 @@ runs:
elif ${{ inputs.deploy_to == 'catalyst' }}; then
# CATALYST
echo "function_name=${{ inputs.app_base_name }}-catalyst" >> $GITHUB_OUTPUT
echo "front_url=${{ inputs.app_base_name }}-catalyst.k-f.dev" >> $GITHUB_OUTPUT
echo "front_url=app-catalyst.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=catalyst" >> $GITHUB_OUTPUT
elif ${{ contains(inputs.deploy_to, 'demo') }}; then
elif ${{ inputs.deploy_to == 'demo' }}; then
# DEMO
echo "function_name=${{ inputs.app_base_name }}-demo" >> $GITHUB_OUTPUT
echo "front_url=${{ inputs.app_base_name }}-demo.k-f.dev" >> $GITHUB_OUTPUT
echo "front_url=app-demo.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=demo" >> $GITHUB_OUTPUT
elif ${{ github.ref == 'refs/heads/main' }}; then
# DEV
echo "function_name=${{ inputs.app_base_name }}-dev" >> $GITHUB_OUTPUT
echo "front_url=${{ inputs.app_base_name }}-dev.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=development" >> $GITHUB_OUTPUT
echo "front_url=app-dev.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=development" >> $GITHUB_OUTPUT
elif ${{ inputs.deploy_to == 'ff-prod' }}; then
# FF-PRODUCTION
# A build from the DEV env that points to prod
echo "function_name=${{ inputs.app_base_name }}-ff-production" >> $GITHUB_OUTPUT
echo "front_url=app-ff-production.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=production" >> $GITHUB_OUTPUT
elif ${{ github.event_name == 'pull_request' }}; then
# PR
echo "function_name=${{ inputs.app_base_name }}-pr${{ github.event.number }}" >> $GITHUB_OUTPUT
echo "front_url=${{ inputs.app_base_name }}-pr${{ github.event.number }}.k-f.dev" >> $GITHUB_OUTPUT
echo "front_url=app-pr${{ github.event.number }}.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=development" >> $GITHUB_OUTPUT
else
echo "::error title=No env to deploy::Workflow called from non-deployable branch/tag"
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/centrifuge-app.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
name: Centrifuge App
on:
push:
branches:
- main
paths:
- 'centrifuge-app/**'
- 'centrifuge-js/**'
- 'centrifuge-react/**'
- '.github/workflows/centrifuge-app.yml'
- '.github/actions/deploy-gcs'
pull_request:
paths:
- 'centrifuge-app/**'
Expand All @@ -23,7 +14,7 @@ on:
required: false
# Fancy concurrency group string to allow for multi-staging deployments
concurrency:
group: 'centrifuge-app-${{ inputs.deploy_env || github.event.inputs.deploy_env }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
group: 'centrifuge-app-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
artifact_name: "webpack${{ inputs.deploy_env && format('-{0}', inputs.deploy_env) }}"
Expand Down Expand Up @@ -103,7 +94,7 @@ jobs:
deploy-app:
concurrency:
# Do not sync the same bucket in parallel
group: deploy-${{ needs.build-app.outputs.front_url }}
group: deploy-${{ needs.build-app.outputs.front_url }}-${{ github.event.name }}
cancel-in-progress: true
permissions:
contents: 'read'
Expand Down Expand Up @@ -138,17 +129,23 @@ jobs:
if: github.event_name == 'pull_request'
steps:
- name: PR comment with preview URL
id: prcomment
uses: thollander/actions-comment-pull-request@v2
env:
pull_sha: ${{ github.event.pull_request.head.sha }}
with:
comment_tag: pr_preview_url
mode: recreate
message: |
PR deployed in Google Cloud
URL: https://${{ needs.deploy-app.outputs.bucket_url }}
Commit #: ${{ env.pull_sha }}
To access the functions directly check the corresponding deploy Action
- name: Check notify outputs
run: |
echo "id : ${{ steps.prcomment.outputs.id }}"
echo "body : ${{ steps.prcomment.outputs.body }}"
echo "html_url : ${{ steps.prcomment.outputs.html_url }}"
# owasp_scan:
# needs: deploy-app
# runs-on: ubuntu-latest
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/deploy_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Deploy all apps"
on:
# Allow this wofkflow as a universal "deployer" to
# call from other workflows.
workflow_call:
inputs:
environment:
required: true
type: string

jobs:
app:
name: webapp
uses: ./.github/workflows/centrifuge-app.yml
secrets: inherit
with:
deploy_env: ${{ inputs.environment}}


pinning:
if: ${{ inputs.environment != 'ff-prod' }}
name: pinning
uses: ./.github/workflows/pinning-api.yml
secrets: inherit
with:
deploy_env: ${{ inputs.environment }}


onboarding:
if: ${{ inputs.environment != 'ff-prod' }}
name: onboarding
uses: ./.github/workflows/onboarding-api.yml
secrets: inherit
with:
deploy_env: ${{ inputs.environment}}

faucet:
if: ${{ inputs.environment == 'demo' || inputs.environment == 'development' }}
name: faucet
uses: ./.github/workflows/faucet-api.yml
secrets: inherit
with:
deploy_env: ${{ inputs.environment}}
19 changes: 5 additions & 14 deletions .github/workflows/faucet-api.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
name: Faucet API
on:
push:
branches:
- main
paths:
- 'faucet-api/**'
- '.github/workflows/faucet-api.yml'
- '.github/actions/deploy-gfunction'
- '.github/actions/build-function'
pull_request:
paths:
- 'faucet-api/**'
Expand All @@ -19,15 +11,11 @@ on:
deploy_env:
type: string
required: false
default: demo
env:
app_name: faucet-api
# For now deploy only on demo when triggered with workflow_call:
deploy_to: ${{ inputs.deploy_env && 'demo' || '' }}
# deploy_to: ${{ inputs_deploy_env }}
function_handler: faucet
concurrency:
group: 'faucet-api@${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
group: 'faucet-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -57,6 +45,9 @@ jobs:
function_name: ${{ steps.prepare.outputs.function_name }}

deploy-faucet:
# if: ${{ inputs.deploy_env == 'demo' }} || ${{ inputs.deploy_env == 'development' }}
# For now deploy only to demo
if: ${{ inputs.deploy_env == 'demo' }}
concurrency:
group: deploy-${{ needs.build-faucet.outputs.function_name }}
cancel-in-progress: false
Expand All @@ -82,4 +73,4 @@ jobs:
target: ${{ env.function_handler }}
gcloud_region: ${{ vars.GCLOUD_REGION }}
service_account: '${{ vars.FIRESTORE_SA }}'
deploy_env: ${{ env.deploy_to }}
deploy_env: ${{ inputs.deploy_env }}
18 changes: 18 additions & 0 deletions .github/workflows/main-branch-deploys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: deploy-main
on:
push:
branches: main
pull_request:
paths:
- '.github/workflows/main-branch-deploys.yml'

jobs:
trigger:
name: deploy-${{ matrix.env }}
strategy:
matrix:
env: ['ff-prod', 'development']
uses: ./.github/workflows/deploy_all.yml
secrets: inherit
with:
environment: ${{ matrix.env }}
17 changes: 17 additions & 0 deletions .github/workflows/manual-deploys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy to Catalyst and demo
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: where to deploy
options:
- demo
- catalyst
jobs:
deploy:
name: deploy-${{ inputs.environment }}
uses: ./.github/workflows/deploy_all.yml
secrets: inherit
with:
environment: ${{ inputs.environment }}
12 changes: 2 additions & 10 deletions .github/workflows/onboarding-api.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
name: Onboarding API
on:
push:
branches:
- main
paths:
- 'onboarding-api/**'
- '.github/workflows/onboarding-api.yml'
- '.github/actions/deploy-gfunction'
- '.github/actions/build-function'
pull_request:
paths:
- 'onboarding-api/**'
Expand All @@ -26,7 +18,7 @@ env:
artifact_name: "onboarding-api${{ inputs.deploy_env && format('-{0}', inputs.deploy_env) }}"
concurrency:
# Fancy concurrency group string to allow for multi-staging deployments
group: 'onboarding-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }} @${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
group: 'onboarding-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -69,7 +61,7 @@ jobs:
deploy-onboarding-api:
concurrency:
# Don't try to deploy the same function in parallel
group: deploy-${{ needs.build-onboarding-api.outputs.function_name }}
group: deploy-${{ needs.build-onboarding-api.outputs.function_name }}-${{ github.event.name}}
cancel-in-progress: true
needs: build-onboarding-api
runs-on: ubuntu-latest
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/pinning-api.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
name: Pinning API
on:
push:
branches:
- main
paths:
- 'pinning-api/**'
- '.github/workflows/pinning-api.yml'
- '.github/actions/deploy-gfunction'
- '.github/actions/build-function'
pull_request:
paths:
- 'pinning-api/**'
Expand All @@ -26,7 +18,7 @@ env:
artifact_name: "pinning-api${{ inputs.deploy_env && format('-{0}', inputs.deploy_env) }}"
concurrency:
# Fancy concurrency group string to allow for multi-staging deployments
group: 'pinning-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }} @${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
group: 'pinning-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build-pinning-api:
Expand All @@ -51,7 +43,7 @@ jobs:
uses: ./.github/actions/build-function
with:
app_name: ${{ env.app_name }}
artifact_name: ${{ env.artifact_name }}
artifact_name: ${{ steps.prepare.outputs.function_name }}

- name: Archive staging artifacts
id: archive_staging
Expand All @@ -68,7 +60,7 @@ jobs:
deploy-pinning-api:
concurrency:
# Don't try to deploy the same function in parallel
group: deploy-${{ needs.build-pinning-api.outputs.function_name }}
group: deploy-${{ needs.build-pinning-api.outputs.function_name }}-${{ github.event.name }}
cancel-in-progress: true
needs: build-pinning-api
runs-on: ubuntu-latest
Expand All @@ -87,7 +79,7 @@ jobs:
uses: ./apps/.github/actions/deploy-gfunction
with:
app_name: ${{ env.app_name }}
artifact_name: ${{ env.artifact_name }}
artifact_name: ${{ needs.build-pinning-api.outputs.function_name }}
GWIP: ${{ secrets.GWIP }}
GSA: ${{ secrets.GSA }}
target: ${{ env.function_handler }}
Expand Down
4 changes: 2 additions & 2 deletions centrifuge-app/.env-config/.env.demo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REACT_APP_COLLATOR_WSS_URL=wss://fullnode.moonbase-dev.cntrfg.com/public-ws
REACT_APP_DEFAULT_NODE_URL=https://pod.moonbeam-alpha.k-f.dev
REACT_APP_COLLATOR_WSS_URL=wss://fullnode.demo.k-f.dev
REACT_APP_DEFAULT_NODE_URL=pod-demo.k-f.dev
REACT_APP_DEFAULT_UNLIST_POOLS=true
REACT_APP_FAUCET_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/faucet-api-demo
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
Expand Down

0 comments on commit d2d1c7f

Please sign in to comment.