This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
forked from 5afe/safe-react
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
490 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: Deploy to Boba network | ||
|
||
# Run on pushes to main or PRs to main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
# Launches build when release is published | ||
release: | ||
types: [published] | ||
|
||
env: | ||
REPO_NAME_ALPHANUMERIC: safereact | ||
REACT_APP_NETWORK: 'boba' | ||
REACT_APP_LATEST_SAFE_VERSION: '1.3.0' | ||
STAGING_BUCKET_NAME: ${{ secrets.STAGING_BOBA_BUCKET_NAME }} | ||
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN_BOBA }} | ||
REACT_APP_GOOGLE_ANALYTICS: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_ID_BOBA }} | ||
REACT_APP_GNOSIS_APPS_URL: ${{ secrets.REACT_APP_GNOSIS_APPS_URL_PROD }} | ||
|
||
jobs: | ||
debug: | ||
name: Debug | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Dump env | ||
run: env | sort | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
deploy: | ||
name: Deployment | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Remove broken apt repos [Ubuntu] | ||
if: ${{ matrix.os }} == 'ubuntu-latest' | ||
run: | | ||
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- run: | | ||
sudo apt-get update | ||
sudo apt-get -y install python3-pip python3-dev libusb-1.0-0-dev libudev-dev | ||
pip install awscli --upgrade --user | ||
# Due to some dependencies yarn may randomly throw an error about invalid cache | ||
# This approach is taken from https://github.com/yarnpkg/yarn/issues/7212#issuecomment-506155894 to fix the issue | ||
# Another approach is to install with flag --network-concurrency 1, but this will make the installation pretty slow (default value is 8) | ||
mkdir .yarncache | ||
yarn install --cache-folder ./.yarncache --frozen-lockfile | ||
rm -rf .yarncache | ||
yarn cache clean | ||
# Set production flag | ||
- name: Set production flag for release PR or tagged build | ||
run: echo "REACT_APP_ENV=production" >> $GITHUB_ENV | ||
if: startsWith(github.ref, 'refs/tags/v') || github.base_ref == 'main' | ||
|
||
- name: Build ${{ env.REACT_APP_NETWORK }} app | ||
run: yarn build | ||
env: | ||
PUBLIC_URL: './' | ||
REACT_APP_FORTMATIC_KEY: ${{ secrets.REACT_APP_FORTMATIC_KEY }} | ||
REACT_APP_INFURA_TOKEN: ${{ secrets.REACT_APP_INFURA_TOKEN }} | ||
REACT_APP_PORTIS_ID: ${{ secrets.REACT_APP_PORTIS_ID }} | ||
REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} | ||
REACT_APP_IPFS_GATEWAY: ${{ secrets.REACT_APP_IPFS_GATEWAY }} | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | ||
|
||
# Script to deploy Pull Requests | ||
- run: bash ./scripts/github/deploy_pull_request.sh | ||
if: success() && github.event.number | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
REVIEW_BUCKET_NAME: ${{ secrets.AWS_REVIEW_BUCKET_NAME }} | ||
REACT_APP_NETWORK: ${{ env.REACT_APP_NETWORK }} | ||
|
||
- name: 'PRaul: Comment PR with app URLs' | ||
uses: mshick/add-pr-comment@v1 | ||
with: | ||
message: | | ||
* [Safe Multisig app ${{ env.REACT_APP_NETWORK }}](${{ env.REVIEW_FEATURE_URL }}/${{ env.REACT_APP_NETWORK }}/app/) | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
repo-token-user-login: 'github-actions[bot]' | ||
if: success() && github.event.number | ||
env: | ||
REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com | ||
|
||
# Script to deploy to the dev environment | ||
|
||
# Script to deploy to staging environment | ||
- name: 'Deploy to S3: Staging' | ||
if: github.ref == 'refs/heads/main' | ||
run: aws s3 sync build s3://${{ env.STAGING_BUCKET_NAME }}/current/app --delete | ||
|
||
# Script to upload release files | ||
- name: 'Upload release build files for production' | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: aws s3 sync build s3://${{ env.STAGING_BUCKET_NAME }}/releases/${{ github.event.release.tag_name }} --delete | ||
# - run: bash ./scripts/github/deploy_release.sh | ||
# if: startsWith(github.ref, 'refs/tags/v') | ||
# env: | ||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# PR_NUMBER: ${{ github.event.number }} | ||
# REVIEW_BUCKET_NAME: ${{ secrets.AWS_REVIEW_BUCKET_NAME }} | ||
# REACT_APP_NETWORK: ${{ env.REACT_APP_NETWORK }} | ||
# VERSION_TAG: ${{ github.event.release.tag_name }} | ||
# Script to prepare production deployments | ||
- run: bash ./scripts/github/prepare_production_deployment.sh | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
PROD_DEPLOYMENT_HOOK_TOKEN: ${{ secrets.PROD_DEPLOYMENT_HOOK_TOKEN }} | ||
PROD_DEPLOYMENT_HOOK_URL: ${{ secrets.PROD_DEPLOYMENT_HOOK_URL }} | ||
VERSION_TAG: ${{ github.event.release.tag_name }} | ||
|
||
# Upload Sentry source maps when sending to staging or production | ||
- run: yarn sentry-upload-sourcemaps | ||
if: success() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | ||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
SENTRY_ORG: ${{ secrets.SENTRY_ORG}} | ||
SENTRY_PROJECT: gnosis-safe-multisig-${{ env.REACT_APP_NETWORK }} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,7 +171,7 @@ | |
"@gnosis.pm/safe-apps-sdk": "4.3.0-next.2", | ||
"@gnosis.pm/safe-apps-sdk-v1": "npm:@gnosis.pm/[email protected]", | ||
"@gnosis.pm/safe-core-sdk": "^0.3.1", | ||
"@gnosis.pm/safe-deployments": "^1.2.0", | ||
"@gnosis.pm/safe-deployments": "^1.3.0", | ||
"@gnosis.pm/safe-react-components": "^0.8.0", | ||
"@gnosis.pm/safe-react-gateway-sdk": "2.3.0", | ||
"@ledgerhq/hw-transport-node-hid-singleton": "6.3.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.