From 03397f9e8f1e327b8dc9786d84c05e0ee133f0dc Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Date: Tue, 16 Mar 2021 16:22:49 +0100 Subject: [PATCH] [CI Improvements] - Build mainnet environment for PRs (#2047) * Enable mainnet build on PRs Enable EWC build on release PRs --- .github/workflows/deploy-ewc.yml | 5 ++++- .github/workflows/deploy-mainnet.yml | 26 ++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-ewc.yml b/.github/workflows/deploy-ewc.yml index 2081c697..add9f8b8 100644 --- a/.github/workflows/deploy-ewc.yml +++ b/.github/workflows/deploy-ewc.yml @@ -1,10 +1,13 @@ name: Deploy to EWC network -# Run on pushes to master +# Run on pushes to master or PRs to master on: push: branches: - master + pull_request: + branches: + - master # Launches build when release is published release: types: [published] diff --git a/.github/workflows/deploy-mainnet.yml b/.github/workflows/deploy-mainnet.yml index 5e12509b..4314804e 100644 --- a/.github/workflows/deploy-mainnet.yml +++ b/.github/workflows/deploy-mainnet.yml @@ -1,7 +1,9 @@ name: Deploy to Mainnet network -# Run on pushes to master +# Run on pushes to master or PRs on: + # Pull request hook without any config. Launches for every pull request + pull_request: push: branches: - master @@ -84,7 +86,27 @@ jobs: aws-region: ${{ secrets.AWS_DEFAULT_REGION }} # Script to deploy Pull Requests - # Mainnet build is never created in Pull Requests + - run: bash ./scripts/github/deploy_pull_request.sh + if: success() && github.event.number + 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 }} + TRAVIS_TAG: ${{ github.event.release.tag_name }} + + - 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]' + allow-repeats: true + 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 development environment # Mainnet build is never created in development branch