Merge pull request #823 from divaprotocol/add-liquidity-entity-in-sub… #117
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
on: | |
push: | |
branches: | |
- main | |
- fix-deployment | |
paths: | |
- 'packages/diva-app/**' | |
- 'packages/diva-infrastructure/**' | |
- '.github/workflows/deploy-infrastructure-and-website.yml' | |
name: Deploy Infrastructure and Website | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- 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: eu-west-2 | |
- name: Checkout current branch | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Cache Node Modules and Turbo Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
**/node_modules | |
**/.yarn/cache | |
.turbo | |
key: ${{ runner.os }}-yarn-turbo-${{ hashFiles('**/yarn.lock', '**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-turbo- | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Verify Node.js and Yarn Versions | |
run: | | |
node -v | |
yarn -v | |
- name: Build Infrastructure and App | |
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 Infrastructure | |
run: yarn turbo run deploy --scope="@diva/infrastructure" | |
- name: Sync to S3 and Invalidate CloudFront Cache | |
run: | | |
aws s3 sync packages/diva-app/build s3://app.diva.finance | |
aws cloudfront create-invalidation --distribution-id E2HCWZDF4NN8G6 --paths '/*' |