Skip to content

Merge pull request #812 from divaprotocol/fix/807-markets-preview-mode #112

Merge pull request #812 from divaprotocol/fix/807-markets-preview-mode

Merge pull request #812 from divaprotocol/fix/807-markets-preview-mode #112

on:
push:
branches:
- main
- fix-deployment
paths:
- 'packages/diva-app/**'
- 'packages/diva-infrastructure/**'
- '.github/workflows/deploy-infrastructure-and-website.yml'
name: Deploy Infrastructure
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Configure AW0S 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: eu-west-2
- name: Checkout current branch
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache Modules
id: cache-modules
uses: actions/cache@v2
with:
path: |
**/node_modules
node_modules
key: ${{ hashFiles('**/yarn.lock', '**/package.json', 'yarn.lock') }}
- name: Cache Turbo Cache
id: build-turbo
uses: actions/cache@v2
with:
path: .turbo
key: ${{ hashFiles('packages/**/*') }}
- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
- name: Build
run: yarn turbo run build --filter=@diva/infrastructure --filter=@diva/app --cache-dir="./.turbo"
env:
CI: false
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY }}
- name: Deploy Infra
run: yarn turbo run deploy --scope="@diva/infrastructure"
- name: sync to s3 and invalidate cache
run: |
aws s3 sync packages/diva-app/build s3://app.diva.finance
aws cloudfront create-invalidation --distribution-id E2HCWZDF4NN8G6 --paths '/*'