Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Licari committed Jan 10, 2024
1 parent 290084b commit bcc780b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
branches:
- main
- dev
- release
tags:
- v*
# Launches build when release is published
release:
types: [published]
Expand Down Expand Up @@ -57,15 +58,15 @@ jobs:

- name: Configure AWS Development credentials
uses: aws-actions/configure-aws-credentials@v1
if: ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' )
if: startsWith(github.event.ref, 'refs/heads/dev') || github.event_name == 'refs/heads/main'
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.DEV_AWS_DEFAULT_REGION }}

- name: Configure AWS Production credentials
uses: aws-actions/configure-aws-credentials@v1
if: ( github.ref == 'refs/heads/release' )
if: startsWith(github.event.ref, 'refs/tags/v') || github.event_name == 'release'
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
Expand All @@ -90,7 +91,7 @@ jobs:
# Script to deploy to release environment
- name: 'Deploy to S3: Release'
working-directory: ./website
if: github.ref == 'refs/heads/release'
if: startsWith(github.event.ref, 'refs/tags/v') || github.event_name == 'release'
run: |
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
Expand Down

0 comments on commit bcc780b

Please sign in to comment.