Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
paridhi-parajuli committed Nov 25, 2024
1 parent c85d537 commit 57a5dc0
Showing 1 changed file with 6 additions and 46 deletions.
52 changes: 6 additions & 46 deletions .github/workflows/deploy-emit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
- cron: '15 17 * * *' # Every day at 12:15 CT (5:15 PM UTC)
workflow_dispatch:
push:
branches: [ emit/animation, test/deployment, production ]
branches: [ main, production ]
paths:
- emit-ch4plume-v1/**


jobs:
Expand All @@ -21,12 +23,9 @@ jobs:
if [ "${{ github.ref }}" = "refs/heads/production" ] || [ "${{ github.event_name }}" = "schedule" ]; then
echo "target_branch=production" >> $GITHUB_OUTPUT
echo "env_name=production" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/test/deployment" ]; then
echo "target_branch=test/deployment" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "target_branch=main" >> $GITHUB_OUTPUT
echo "env_name=staging" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/emit/animation" ]; then
echo "target_branch=emit/animation" >> $GITHUB_OUTPUT
echo "env_name=development" >> $GITHUB_OUTPUT
fi
- name: Print the environment
run: echo "The environment is ${{ steps.define_environment.outputs.env_name }}"
Expand Down Expand Up @@ -73,7 +72,7 @@ jobs:
needs:
- build
- define-environment
if: needs.define-environment.outputs.target_branch == 'test/deployment'
if: needs.define-environment.outputs.target_branch == 'main'
environment: ${{ needs.define-environment.outputs.env_name }}

permissions:
Expand Down Expand Up @@ -108,45 +107,6 @@ jobs:
distribution-id: ${{ secrets.CF_DISTRIBUTION_ID }}
paths: |
/${{ env.PUBLIC_URL }}*
deploy-development:
needs:
- build
- define-environment
if: needs.define-environment.outputs.target_branch == 'emit/animation'
environment: ${{ needs.define-environment.outputs.env_name }}

permissions:
id-token: write
contents: read

runs-on: ubuntu-latest
steps:

- name: Download dist folder
uses: actions/download-artifact@v4
with:
name: dist_folder
path: ./emit-ch4plume-v1/dist

- name: ConfigureAWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.DEPLOYMENT_ROLE_ARN }}
role-session-name: ${{ github.repository_owner}}
aws-region: us-west-2

- name: Upload to S3
run: |
export PUBLIC_URL=$(echo ${{ vars.PUBLIC_URL_EMIT }} | sed -E 's|^https?://[^/]+/||')
echo "PUBLIC_URL=${PUBLIC_URL}" >> $GITHUB_ENV
aws s3 sync "./emit-ch4plume-v1/dist" s3://ghgc-custom-interfaces-develop/${PUBLIC_URL}/ --cache-control max-age=30,must-revalidate,s-maxage=604800 --delete
- name: Request Invalidation to AWS Cloudfront
uses: oneyedev/aws-cloudfront-invalidation@v1
with:
distribution-id: ${{ secrets.CF_DISTRIBUTION_ID }}
paths: |
/${{ env.PUBLIC_URL }}*
deploy-production:
needs:
Expand Down

0 comments on commit 57a5dc0

Please sign in to comment.