Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrennan414 authored Nov 5, 2024
1 parent 16bc70c commit 615a334
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
name: Deploy to S3 and Invalidate CloudFront with Assume Role

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS credentials using Assume Role
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.PORTFOLIO_AWS_ROLE_ARN }}
aws-region: us-west-2
role-session-name: johnbrennan.codes-trust-role

- name: Sync S3 bucket
run: |
aws s3 sync . ${{ secrets.PORTFOLIO_BUCKET }} --delete
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.PORTFOLIO_CLOUDFRONT_DISTRIBUTION_ID }} \
--paths "/*"
- name: Diagnose AWS credential issues
run: |
aws sts get-caller-identity

0 comments on commit 615a334

Please sign in to comment.