-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: deploy prod build to aws | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy-dev: | ||
runs-on: ubuntu-latest | ||
env: | ||
# default build directory | ||
BUILD_FOLDER: 'build/' | ||
VERSION: 'latest' | ||
|
||
REACT_APP_API_HOST: ${{ secrets.API_HOST }} | ||
REACT_APP_UPLOAD_METHOD: default | ||
REACT_APP_S3_FILES_HOST: ${{ secrets.S3_FILES_HOST }} | ||
REACT_APP_SHOW_NOTIFICATIONS: true | ||
REACT_APP_AUTHENTICATION_HOST: ${{ secrets.AUTH_HOST }} | ||
REACT_APP_GRAASP_PERFORM_HOST: ${{ secrets.PERFORM_HOST }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Yarn Set Up | ||
uses: actions/setup-node@v2 | ||
|
||
- run: yarn install --network-concurrency 1 | ||
- run: yarn build | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.COMPOSE_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.COMPOSE_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.COMPOSE_AWS_REGION }} | ||
|
||
- name: Copy files to AWS Bucket | ||
env: | ||
COMPOSE_DIR: '${{ secrets.COMPOSE_PROD_BUCKET }}' | ||
run: aws s3 sync ${{env.BUILD_FOLDER}} s3://${COMPOSE_DIR} --delete | ||
|
||
- name: Invalidate cloudfront distribution | ||
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.COMPOSE_PROD_CLOUDFRONT_DISTRIBUTION }} --paths '/*' |
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