fix: use correct 'IPv4'/'IPv6' text formatting #22
This file contains 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 to S3 | |
concurrency: deploy-to-s3 | |
on: | |
push: | |
branches: [main] | |
paths: | |
# Match the file types included in the copy command in the "Copy to S3" step | |
- '*.js' | |
- '*.css' | |
- '*.html' | |
workflow_dispatch: | |
jobs: | |
deploy-site: | |
name: Deploy | |
runs-on: ubuntu-24.04 | |
permissions: | |
id-token: write | |
contents: read | |
environment: | |
name: prod | |
url: ${{ vars.DEPLOYMENT_URL }} | |
steps: | |
- name: Clone the repository | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ROLE_NAME }} | |
role-session-name: Deployment${{ github.run_id }}-${{ github.run_attempt }} | |
role-duration-seconds: 900 | |
- name: Copy to S3 | |
# Ensure the cp command matches the paths in the 'on.push.paths' config | |
run: | | |
STAGING_DIR="$(mktemp -d)" | |
cp *.js *.html *.css "$STAGING_DIR/" | |
aws s3 sync "$STAGING_DIR/" s3://${{ secrets.AWS_S3_BUCKET_NAME }} | |
- name: Invalidate cache | |
run: | | |
aws cloudfront create-invalidation --distribution-id "${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}" --paths "/*" |