Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build previews using dapp-development tagged packages #147

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 57 additions & 11 deletions .github/workflows/dashboard-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
- name: Configure git to don't use unauthenticated protocol
run: git config --global url."https://".insteadOf git://

# TODO: Add upgrade of @keep-network/random-beacon, @keep-network/ecdsa,
# @keep-network/tbtc-v2 once they'll be added as dashboard's dependencies.
- name: Resolve latest contracts
run: |
yarn upgrade \
Expand All @@ -80,9 +82,10 @@ jobs:
# - name: Test
# run: yarn test

build-and-deploy-testnet:
build-and-deploy-testnet-preview:
name: Deploy to testnet
needs: build-and-test
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -103,10 +106,12 @@ jobs:
# We provide explicit version of the `keep-core` package, because using
# `goerli` tag results in `expected manifest` error - probably caused by
# bug in Yarn: https://github.com/yarnpkg/yarn/issues/4731.
# TODO: Add upgrade of @keep-network/random-beacon, @keep-network/ecdsa,
# @keep-network/tbtc-v2 once they'll be added as dashboard's dependencies.
- name: Resolve latest goerli contracts
run: |
yarn upgrade \
@threshold-network/solidity-contracts@goerli \
@threshold-network/solidity-contracts@dapp-development-goerli \
@keep-network/[email protected] \
@keep-network/keep-ecdsa@goerli \
@keep-network/tbtc@goerli \
Expand All @@ -124,9 +129,7 @@ jobs:
ETH_HOSTNAME_HTTP: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.GOERLI_ETH_HOSTNAME_WS }}

# A pull_request event is a PR; deploy to preview testnet bucket.
- name: Deploy PR preview to GCP
if: github.event_name == 'pull_request'
uses: thesis/[email protected]
with:
service-key: ${{ secrets.KEEP_TEST_CI_UPLOAD_DAPP_JSON_KEY_BASE64 }}
Expand All @@ -136,7 +139,6 @@ jobs:
build-folder: build

- name: Post preview URL to PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v5
with:
script: |
Expand All @@ -147,13 +149,57 @@ jobs:
body: 'Preview uploaded to https://preview.dashboard.test.threshold.network/${{ github.head_ref }}/index.html.'
})

# A push event is triggered on main branch merge; deploy to testnet
# bucket. Also triggered by manual dispatch from `main` branch.
build-and-deploy-testnet:
name: Deploy to testnet
needs: build-and-test
if: |
github.event_name == 'push'
|| (github.event_name == 'workflow_dispatch'
&& github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: "16"
cache: "yarn"

# We need this step because the `@keep-network/tbtc` which we update in
# next step has a dependency to `@summa-tx/[email protected]` package, which
# downloads one of its sub-dependencies via unathenticated `git://`
# protocol. That protocol is no longer supported. Thanks to this step
# `https://` is used instead of `git://`.
- name: Configure git to don't use unauthenticated protocol
run: git config --global url."https://".insteadOf git://

# We provide explicit version of the `keep-core` package, because using
# `goerli` tag results in `expected manifest` error - probably caused by
# bug in Yarn: https://github.com/yarnpkg/yarn/issues/4731.
# TODO: Add upgrade of @keep-network/random-beacon, @keep-network/ecdsa,
# @keep-network/tbtc-v2 once they'll be added as dashboard's dependencies.
- name: Resolve latest goerli contracts
run: |
yarn upgrade \
@threshold-network/solidity-contracts@goerli \
@keep-network/[email protected] \
@keep-network/keep-ecdsa@goerli \
@keep-network/tbtc@goerli \
@keep-network/coverage-pools@goerli

- name: Run postinstall script
# `yarn upgrade` doesn't trigger the `postinstall` script.
run: yarn run postinstall

- name: Build
run: yarn build
env:
PUBLIC_URL: /${{ github.head_ref }}
CHAIN_ID: 5
ETH_HOSTNAME_HTTP: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.GOERLI_ETH_HOSTNAME_WS }}

- name: Deploy to GCP bucket
if: |
github.event_name == 'push'
|| (github.event_name == 'workflow_dispatch'
&& github.ref == 'refs/heads/main')
uses: thesis/[email protected]
with:
service-key: ${{ secrets.KEEP_TEST_CI_UPLOAD_DAPP_JSON_KEY_BASE64 }}
Expand Down