File tree Expand file tree Collapse file tree 3 files changed +200
-49
lines changed Expand file tree Collapse file tree 3 files changed +200
-49
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy static site in AWS CDN
2+ on :
3+ workflow_dispatch :
4+ jobs :
5+ deploy_cdn :
6+ runs-on : ubuntu-latest
7+ if : startsWith(github.ref, 'refs/tags')
8+ env :
9+ S3_BUCKET_NAME : ${{ secrets.S3_BUCKET_NAME }}
10+ ID_DISTRIBUTION : ${{ secrets.ID_DISTRIBUTION }}
11+ PATH_BUILD : ${{ secrets.PATH_BUILD || 'out' }}
12+ NODE_VERSION : ${{ secrets.NODE_VERSION || '20.18.0' }}
13+ STAGE : ${{ secrets.STAGE || 'prod' }}
14+ steps :
15+ - uses : actions/checkout@v4
16+ - name : Use Node.js
17+ uses : actions/setup-node@v4
18+ with :
19+ node-version : ${{ env.NODE_VERSION }}
20+ - name : build static page
21+ run : |
22+ npm install
23+ npm run build
24+ - name : Set up AWS CLI
25+ uses : aws-actions/configure-aws-credentials@v4
26+ with :
27+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
28+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29+ aws-region : ${{ secrets.AWS_REGION || 'us-east-1'}}
30+ - name : Upload to S3
31+ run : |
32+ aws configure set preview.cloudfront true
33+ find ${{ env.PATH_BUILD }} -type f -empty -delete
34+ aws s3 sync --delete ${{ env.PATH_BUILD }} s3://$S3_BUCKET_NAME/
35+ aws cloudfront create-invalidation --distribution-id $ID_DISTRIBUTION --path '/*'
Original file line number Diff line number Diff line change @@ -19,19 +19,19 @@ const commonsEnvs = {
1919const envs : EnvsType = {
2020 local : {
2121 ...commonsEnvs ,
22- BASE_URL_MIGRATION : 'http://localhost:8080/ '
22+ BASE_URL_MIGRATION : 'http://localhost:8080'
2323 } ,
2424 dev : {
2525 ...commonsEnvs ,
26- BASE_URL_MIGRATION : 'https://api-bice.bennu.cl/ '
26+ BASE_URL_MIGRATION : 'https://api-bice.bennu.cl'
2727 } ,
2828 stg : {
2929 ...commonsEnvs ,
30- BASE_URL_MIGRATION : 'https://api-bice.bennu.cl/ '
30+ BASE_URL_MIGRATION : 'https://api-bice.bennu.cl'
3131 } ,
3232 pro : {
3333 ...commonsEnvs ,
34- BASE_URL_MIGRATION : 'https://api-bice.bennu.cl/ '
34+ BASE_URL_MIGRATION : 'https://api-bice.bennu.cl'
3535 }
3636}
3737
@@ -45,7 +45,7 @@ const getStage = (): StageType => {
4545}
4646
4747const nextConfig : NextConfig = {
48- output : 'standalone ' ,
48+ output : 'export ' ,
4949 env : envs [ getStage ( ) ] ,
5050 typescript : {
5151 ignoreBuildErrors : true
You can’t perform that action at this time.
0 commit comments