Use Devops script to upload to AWS in staging and development (#1950)

This commit is contained in:
Daniel Sanchez 2021-02-24 21:21:36 +01:00 committed by GitHub
parent 3f413cf86c
commit 794e38abe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 35 deletions

View File

@ -98,17 +98,20 @@ jobs:
env: env:
REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com
- 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 to development environment # Script to deploy to development environment
# xDai build is never created in development branch # EWC build is never created in development branch
# Script to deploy to staging environment # Script to deploy to staging environment
- name: 'Deploy to S3: Staging' - name: 'Deploy to S3: Staging'
run: bash ./scripts/github/deploy_to_s3_bucket.sh
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
env: run: aws s3 sync build s3://${{ secrets.STAGING_BUCKET_NAME }}/current/app --delete
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
BUCKET_NAME: ${{ env.STAGING_BUCKET_NAME }}
# Script to upload release files # Script to upload release files
- run: bash ./scripts/github/deploy_release.sh - run: bash ./scripts/github/deploy_release.sh

View File

@ -76,20 +76,23 @@ jobs:
REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }}
REACT_APP_IPFS_GATEWAY: ${{ secrets.REACT_APP_IPFS_GATEWAY }} 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 # Script to deploy Pull Requests
# Mainnet build is never created in Pull Requests # Mainnet build is never created in Pull Requests
# Script to deploy to development environment # Script to deploy to development environment
# Mainnet build is never created in development branch # Mainnet build is never created in development branch
# Script to deploy to staging environment # Script to deploy to staging environment
- name: 'Deploy to S3: Staging' - name: 'Deploy to S3: Staging'
run: bash ./scripts/github/deploy_to_s3_bucket.sh if: github.ref == 'refs/heads/master' # Or refs/heads/main
if: github.ref == 'refs/heads/master' run: aws s3 sync build s3://${{ secrets.STAGING_BUCKET_NAME }}/current/app --delete
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
BUCKET_NAME: ${{ env.STAGING_BUCKET_NAME }}
# Script to upload release files # Script to upload release files
- run: bash ./scripts/github/deploy_release.sh - run: bash ./scripts/github/deploy_release.sh

View File

@ -80,6 +80,13 @@ jobs:
REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }}
REACT_APP_IPFS_GATEWAY: ${{ secrets.REACT_APP_IPFS_GATEWAY }} 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 # Script to deploy Pull Requests
- run: bash ./scripts/github/deploy_pull_request.sh - run: bash ./scripts/github/deploy_pull_request.sh
if: success() && github.event.number if: success() && github.event.number
@ -105,21 +112,13 @@ jobs:
# Script to deploy to development environment # Script to deploy to development environment
- name: 'Deploy to S3: Develop' - name: 'Deploy to S3: Develop'
run: bash ./scripts/github/deploy_to_s3_bucket.sh if: github.ref == 'refs/heads/develop'
if: github.ref == 'refs/heads/development' run: aws s3 sync build s3://${{ secrets.AWS_DEV_BUCKET_NAME }}/app --delete
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
BUCKET_NAME: ${{ secrets.AWS_DEV_BUCKET_NAME }}
# Script to deploy to staging environment # Script to deploy to staging environment
- name: 'Deploy to S3: Staging' - name: 'Deploy to S3: Staging'
run: bash ./scripts/github/deploy_to_s3_bucket.sh
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
env: run: aws s3 sync build s3://${{ secrets.STAGING_BUCKET_NAME }}/current/app --delete
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
BUCKET_NAME: ${{ env.STAGING_BUCKET_NAME }}
# Script to upload release files # Script to upload release files
- run: bash ./scripts/github/deploy_release.sh - run: bash ./scripts/github/deploy_release.sh

View File

@ -101,17 +101,21 @@ jobs:
env: env:
REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com
- 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 to development environment # Script to deploy to development environment
# xDai build is never created in development branch # Volta build is never created in development branch
# Script to deploy to staging environment # Script to deploy to staging environment
- name: 'Deploy to S3: Staging' - name: 'Deploy to S3: Staging'
run: bash ./scripts/github/deploy_to_s3_bucket.sh
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
env: run: aws s3 sync build s3://${{ secrets.STAGING_BUCKET_NAME }}/current/app --delete
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
BUCKET_NAME: ${{ env.STAGING_BUCKET_NAME }}
# Script to upload release files # Script to upload release files
- run: bash ./scripts/github/deploy_release.sh - run: bash ./scripts/github/deploy_release.sh

View File

@ -101,17 +101,20 @@ jobs:
env: env:
REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com
- 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 to development environment # Script to deploy to development environment
# xDai build is never created in development branch # xDai build is never created in development branch
# Script to deploy to staging environment # Script to deploy to staging environment
- name: 'Deploy to S3: Staging' - name: 'Deploy to S3: Staging'
run: bash ./scripts/github/deploy_to_s3_bucket.sh
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
env: run: aws s3 sync build s3://${{ secrets.STAGING_BUCKET_NAME }}/current/app --delete
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
BUCKET_NAME: ${{ env.STAGING_BUCKET_NAME }}
# Script to upload release files # Script to upload release files
- run: bash ./scripts/github/deploy_release.sh - run: bash ./scripts/github/deploy_release.sh