Skip to content

Commit 9da1f10

Browse files
authored
Update and rename frontend-ci.yml to frontend.yml
1 parent 3e060b3 commit 9da1f10

File tree

2 files changed

+51
-30
lines changed

2 files changed

+51
-30
lines changed

Diff for: .github/workflows/frontend-ci.yml

-30
This file was deleted.

Diff for: .github/workflows/frontend.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Frontend CI/CD
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '14'
20+
cache: 'yarn'
21+
cache-dependency-path: Sample-01/yarn.lock
22+
23+
- name: Install dependencies
24+
run: cd Sample-01 && yarn install
25+
26+
- name: Lint
27+
run: cd Sample-01 && yarn lint
28+
29+
- name: Build
30+
run: cd Sample-01 && yarn build
31+
32+
- name: Deploy to S3
33+
uses: jakejarvis/s3-sync-action@v0.5.1
34+
with:
35+
args: --delete
36+
env:
37+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
38+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
AWS_REGION: 'us-east-1'
41+
SOURCE_DIR: 'Sample-01/build' # Ajusta esto si tu directorio de build es diferente
42+
43+
- name: Invalidate CloudFront Cache
44+
uses: chetan/invalidate-cloudfront-action@v1.4
45+
with:
46+
distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
47+
paths: '/*'
48+
env:
49+
AWS_REGION: 'us-east-2'
50+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
51+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 commit comments

Comments
 (0)