Skip to content

Commit a0f1344

Browse files
committed
feat: adiciona CI/CD com GitHub Actions
1 parent 31d2ad9 commit a0f1344

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Portfolio to AWS
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Configure AWS credentials
16+
uses: aws-actions/configure-aws-credentials@v4
17+
with:
18+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
19+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
20+
aws-region: us-east-1
21+
22+
- name: Sync files to S3
23+
run: |
24+
aws s3 sync public/ s3://portfolio-sergio-sena --delete --exclude "*.git*"
25+
26+
- name: Invalidate CloudFront cache
27+
run: |
28+
aws cloudfront create-invalidation --distribution-id E2DXHLX2VFCW6L --paths "/*"

0 commit comments

Comments
 (0)