script fix #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Resume to S3 + Invalidate CloudFront | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| name: Upload to S3 and Invalidate CloudFront | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS credentials (eu-north-1) | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: eu-north-1 | |
| - name: Package Lambda | |
| run: bash scripts/package-lambda.sh | |
| - name: Deploy static site to S3 | |
| run: | | |
| aws s3 sync ./resume-website s3://wizfi-bucket \ | |
| --delete \ | |
| --exclude ".git/*" \ | |
| --exclude ".github/*" | |
| - name: Configure AWS credentials (CloudFront - us-east-1) | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Invalidate CloudFront cache | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id EG6N3RCWLM0WT \ | |
| --paths "/*" |