Skip to content

Commit

Permalink
ci: CD on homolog env
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLorijola committed Oct 30, 2023
1 parent 7d08440 commit dec3ce9
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: DeployAWS

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20.8
- name: install dependencies
run: yarn install
- name: build project
run: turbo run build

- uses: shinyinc/[email protected]
- name: sync static with s3
run: aws s3 sync apps/static s3://${{ secrets.AWS_S3_BUCKET_NAME }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1

- name: sync react with s3
run: aws s3 sync apps/react/dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/react
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1

- name: sync container with s3
run: aws s3 sync apps/container/dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/app
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1

- name: invalidate cloudfront cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1

0 comments on commit dec3ce9

Please sign in to comment.