Skip to content

Commit

Permalink
Deployment test
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-mosher committed Jul 30, 2024
1 parent f00ae02 commit b60e055
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 30 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy to S3 and Invalidate CloudFront

on:
push:
branches:
- aws-pipeline

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Sync S3 bucket
env:
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
run: aws s3 sync ./dist s3://$S3_BUCKET_NAME --delete

- name: Invalidate CloudFront
env:
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
run: |
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
30 changes: 0 additions & 30 deletions README copy.md

This file was deleted.

0 comments on commit b60e055

Please sign in to comment.