Skip to content

Commit

Permalink
CI: run update-deposits in build step, push data folder to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomognosis committed May 18, 2024
1 parent c40d32c commit 985bcb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
pip install awscli --upgrade --user
- name: Build App
run: yarn build
run: yarn update-deposits && yarn build

- name: Configure AWS Development credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -56,10 +56,12 @@ jobs:
run: |
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync data/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev
# Script to deploy to staging environment
- name: 'Deploy to S3: Staging'
if: github.ref == 'refs/heads/main'
run: |
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync data/ s3://${{ secrets.DEV_BUCKET_NAME }}/main
3 changes: 2 additions & 1 deletion .github/workflows/prod_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
pip install awscli --upgrade --user
- name: Build App for release
run: yarn build
run: yarn update-deposits && yarn build

- name: Configure AWS Production credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -67,6 +67,7 @@ jobs:
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*.html" --exclude "sitemap.xml" --cache-control max-age=86400,public
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*" --include "sitemap.xml" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/xml
aws s3 sync data/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete
notify:
uses: ./.github/workflows/slack_release_notification.yml
Expand Down

0 comments on commit 985bcb8

Please sign in to comment.