Skip to content

Commit

Permalink
Merge pull request #20 from dlv237/Pipeline-S3-Cloudfront
Browse files Browse the repository at this point in the history
Update, job for S3 and Cloudfront Deploy
  • Loading branch information
FabianMF1 authored May 22, 2024
2 parents c422ad1 + e0e08df commit 464ab52
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Lintern
name: CI/CD Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main # Adjust this to match your main branch name
- main

jobs:
test-and-lint:
Expand All @@ -23,3 +26,30 @@ jobs:

- name: Lint with npm
run: npm run lint

deploy:
needs: test-and-lint
runs-on: ubuntu-latest

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

- 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: us-east-1

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Deploy to S3
run: aws s3 sync dist/ s3://flightsdeploybucket --delete

- name: Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id E1TASZURWXXX8L --paths "/*"

0 comments on commit 464ab52

Please sign in to comment.