Skip to content

Commit

Permalink
Make CI deploy to prod work for both releases and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomolicari committed Feb 1, 2022
1 parent 507029d commit 389c75e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/web-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ jobs:
if: github.ref == 'refs/heads/master'
run: aws s3 sync out s3://${{ secrets.AWS_DEV_BUCKET_NAME }}/current --delete

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

# Script to upload release files
- name: 'Upload release build files for production'
if: startsWith(github.ref, 'refs/tags/v')
run: aws s3 sync out s3://${{ secrets.AWS_DEV_BUCKET_NAME }}/releases/${{ github.event.release.tag_name }} --delete
run: aws s3 sync out s3://${{ secrets.AWS_DEV_BUCKET_NAME }}/releases/${{ steps.get_version.outputs.VERSION }} --delete

# Script to prepare production deployments
- run: bash ./.github/scripts/prepare_production_deployment.sh
Expand All @@ -66,4 +70,4 @@ jobs:
env:
PROD_DEPLOYMENT_HOOK_TOKEN: ${{ secrets.PROD_DEPLOYMENT_HOOK_TOKEN }}
PROD_DEPLOYMENT_HOOK_URL: ${{ secrets.PROD_DEPLOYMENT_HOOK_URL }}
VERSION_TAG: ${{ github.event.release.tag_name }}
VERSION_TAG: ${{ steps.get_version.outputs.VERSION }}

0 comments on commit 389c75e

Please sign in to comment.