Skip to content

Commit

Permalink
migrate to cloudflare workers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjeev committed Oct 8, 2021
1 parent 2d5aaa7 commit 4fca68b
Show file tree
Hide file tree
Showing 18 changed files with 321 additions and 280 deletions.
15 changes: 0 additions & 15 deletions .dockerignore

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Checks

on:
pull_request:
branches: [main]

jobs:
check:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 14.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
- run: npm ci
- run: npm run build --if-present
41 changes: 12 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,16 @@ jobs:
- run: npm ci
- run: npm run build --if-present
env:
CI: false
REACT_APP_API_KEY: ${{ secrets.PRODUCTION_REST_ENDPOINT }}
REACT_APP_TENDERMINT_RPC_ENDPOINT: ${{ secrets.PRODUCTION_RPC_ENDPOINT }}
REACT_APP_WEBSITE_URL: ${{ secrets.PRODUCTION_WEBSITE_URL }}
REACT_APP_EXPLORER_API: ${{ secrets.PRODUCTION_EXPLORER }}
REACT_APP_MAIL_CHIMP_URL: ${{ secrets.PRODUCTION_MAILCHIMP }}
REACT_APP_PROXY_API: ${{ secrets.PROXY_API }}
REACT_APP_CHAIN_ID: ${{ secrets.PRODUCTION_CHAIN_ID }}
REACT_APP_CHAIN_NAME: ${{ secrets.PRODUCTION_CHAIN_NAME }}
REACT_APP_IBC_CONFIG: ${{ secrets.PRODUCTION_IBC_CONFIG}}
- name: zip up the build
uses: montudor/[email protected]
REACT_APP_API_KEY: 'https://rest.core.persistence.one'
REACT_APP_TENDERMINT_RPC_ENDPOINT: 'https://rpc.core.persistence.one'
REACT_APP_WEBSITE_URL: 'https://wallet.persistence.one'
REACT_APP_EXPLORER_API: 'https://explorer.persistence.one'
REACT_APP_MAIL_CHIMP_URL: 'https://one.us17.list-manage.com/subscribe/post?u=fd70c7f5c39a43acbedb49253&id=7f8e2dbc48'
REACT_APP_CHAIN_ID: 'core-1'
REACT_APP_CHAIN_NAME: 'Persistence'
REACT_APP_IBC_CONFIG: 'ibcMainnet.json'
- name: Publish
uses: cloudflare/[email protected]
with:
args: zip -qq -r build.zip build
- name: Operations
uses: alinz/ssh-scp-action@master
with:
key: ${{ secrets.PRODUCTION_SSH_KEY }}
host: ${{ secrets.PRODUCTION_HOST }}
port: 22
user: ${{ secrets.PRODUCTION_USERNAME }}
# runs this on remove server
ssh_before: |
rm -r build.zip
# then uploads these 2 files
scp: |
build.zip ${{ secrets.PRODUCTION_USERNAME }}@${{ secrets.PRODUCTION_HOST }}:~/build.zip
# then run these commands
ssh_after: |
${{ secrets.PRODUCTION_UPDATE_SCRIPT }}
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'release'
84 changes: 27 additions & 57 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Staging Deploy
name: Staging

on:
push:
Expand All @@ -27,35 +27,20 @@ jobs:
- run: npm run build --if-present
env:
CI: false
REACT_APP_API_KEY: ${{ secrets.STAGING_REST_ENDPOINT }}
REACT_APP_TENDERMINT_RPC_ENDPOINT: ${{ secrets.STAGING_RPC_ENDPOINT }}
REACT_APP_WEBSITE_URL: ${{ secrets.TESTNET_STAGING_URL }}
REACT_APP_EXPLORER_API: ${{ secrets.STAGING_EXPLORER }}
REACT_APP_MAIL_CHIMP_URL: ${{ secrets.STAGING_MAILCHIMP }}
REACT_APP_PROXY_API: ${{ secrets.PROXY_API }}
REACT_APP_CHAIN_ID: ${{ secrets.STAGING_CHAIN_ID }}
REACT_APP_CHAIN_NAME: ${{ secrets.STAGING_CHAIN_NAME }}
REACT_APP_IBC_CONFIG: ${{ secrets.STAGING_IBC_CONFIG }}
- name: zip up the build
uses: montudor/[email protected]
REACT_APP_API_KEY: 'https://rest.testnet.persistence.one'
REACT_APP_TENDERMINT_RPC_ENDPOINT: 'https://rpc.testnet.persistence.one'
REACT_APP_WEBSITE_URL: 'https://test-core-1.wallet.persistence.one'
REACT_APP_EXPLORER_API: 'https://test-core-1.explorer.persistence.one'
REACT_APP_MAIL_CHIMP_URL: 'https://one.us17.list-manage.com/subscribe/post?u=fd70c7f5c39a43acbedb49253&id=7f8e2dbc48'
REACT_APP_CHAIN_ID: 'test-core-1'
REACT_APP_CHAIN_NAME: 'Persistence Testnet'
REACT_APP_IBC_CONFIG: 'ibcStaging.json'
- name: Publish
uses: cloudflare/[email protected]
with:
args: zip -qq -r build_testnet.zip build
- name: Operations
uses: alinz/ssh-scp-action@master
with:
key: ${{ secrets.STAGING_SSH_KEY }}
host: ${{ secrets.STAGING_HOST }}
port: 22
user: ${{ secrets.STAGING_USERNAME }}
# runs this on remove server
ssh_before: |
rm -r build_testnet.zip
# then uploads these 2 files
scp: |
build_testnet.zip ${{ secrets.STAGING_USERNAME }}@${{ secrets.STAGING_HOST }}:~/build_testnet.zip
# then run these commands
ssh_after: |
${{ secrets.STAGING_TESTNET_SCRIPT }}
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'testnet-staging'


mainnet:
runs-on: ubuntu-latest
Expand All @@ -70,36 +55,21 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
- run: npm ci
- run: npm run build --if-present
env:
CI: false
REACT_APP_API_KEY: ${{ secrets.PRODUCTION_REST_ENDPOINT }}
REACT_APP_TENDERMINT_RPC_ENDPOINT: ${{ secrets.PRODUCTION_RPC_ENDPOINT }}
REACT_APP_WEBSITE_URL: ${{ secrets.MAINNET_STAGING_URL }}
REACT_APP_EXPLORER_API: ${{ secrets.PRODUCTION_EXPLORER }}
REACT_APP_MAIL_CHIMP_URL: ${{ secrets.PRODUCTION_MAILCHIMP }}
REACT_APP_PROXY_API: ${{ secrets.PROXY_API }}
REACT_APP_CHAIN_ID: ${{ secrets.PRODUCTION_CHAIN_ID }}
REACT_APP_CHAIN_NAME: ${{ secrets.PRODUCTION_CHAIN_NAME }}
REACT_APP_IBC_CONFIG: ${{ secrets.PRODUCTION_IBC_CONFIG }}
- name: zip up the build
uses: montudor/[email protected]
with:
args: zip -qq -r build_mainnet.zip build
- name: Operations
uses: alinz/ssh-scp-action@master
REACT_APP_API_KEY: 'https://rest.core.persistence.one'
REACT_APP_TENDERMINT_RPC_ENDPOINT: 'https://rest.core.persistence.one'
REACT_APP_WEBSITE_URL: 'https://staging.wallet.persistence.one'
REACT_APP_EXPLORER_API: 'https://explorer.persistence.one'
REACT_APP_MAIL_CHIMP_URL: 'https://one.us17.list-manage.com/subscribe/post?u=fd70c7f5c39a43acbedb49253&id=7f8e2dbc48'
REACT_APP_CHAIN_ID: 'core-1'
REACT_APP_CHAIN_NAME: 'Persistence'
REACT_APP_IBC_CONFIG: 'ibcMainnet.json'
- name: Publish
uses: cloudflare/[email protected]
with:
key: ${{ secrets.STAGING_SSH_KEY }}
host: ${{ secrets.STAGING_HOST }}
port: 22
user: ${{ secrets.STAGING_USERNAME }}
# runs this on remove server
ssh_before: |
rm -r build_mainnet.zip
# then uploads these 2 files
scp: |
build_mainnet.zip ${{ secrets.STAGING_USERNAME }}@${{ secrets.STAGING_HOST }}:~/build_mainnet.zip
# then run these commands
ssh_after: |
${{ secrets.STAGING_MAINNET_SCRIPT }}
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'mainnet-staging'
65 changes: 0 additions & 65 deletions .github/workflows/testing.yaml

This file was deleted.

Loading

0 comments on commit 4fca68b

Please sign in to comment.