Skip to content

Commit 50f4393

Browse files
author
Manuel Humberto Colonia Vela [NE]
committed
GHA: permission token #2
1 parent 21800d6 commit 50f4393

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/apidoc-build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Build and Upload
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches:
76
- sc-ddt-gha
@@ -24,7 +23,7 @@ env:
2423
permissions:
2524
contents: read
2625
id-token: write
27-
26+
2827
jobs:
2928
build-and-upload:
3029
environment: ${{ github.ref_name == 'master' && 'staging' || github.ref_name == 'release' && 'produccion' || github.ref_name == 'sc-*' && 'ephemeral' }}
@@ -33,8 +32,8 @@ jobs:
3332
&& vars.AWS_RG_NAME_PRO || vars.AWS_RG_NAME_NONPRO }}
3433
env:
3534
ENVIRONMENT: ${{ github.ref_name == 'master' && 'staging' || github.ref_name == 'release' && 'prod' || github.ref_name == 'sc-*' && 'ephemeral' }}
36-
OUT_DIR: ${{ github.ref == 'refs/heads/master' && 'build/staging' || github.ref == 'refs/heads/release' && 'build/prod' || startsWith(github.ref, 'refs/heads/sc-') && 'build/dev' }}
37-
S3_BUCKET: ${{ github.ref == 'refs/heads/master' && vars.S3_BUCKET_STAGING || github.ref == 'refs/heads/release' && vars.S3_BUCKET_PRODUCTION || startsWith(github.ref, 'refs/heads/sc-') && 'aplazame-ephemeral-environments' }}
35+
OUT_DIR: ${{ github.ref == 'refs/heads/master' && 'build/staging' || github.ref == 'refs/heads/release' && 'build/prod' || startsWith(github.ref, 'refs/heads/sc-') && 'build/staging' }}
36+
S3_BUCKET: ${{ github.ref == 'refs/heads/master' && vars.S3_BUCKET_STAGING || github.ref == 'refs/heads/release' && vars.S3_BUCKET_PRODUCTION || startsWith(github.ref, 'refs/heads/sc-') && 'ephemeral-environments' }}
3837
steps:
3938
- name: Checkout code
4039
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
@@ -73,6 +72,6 @@ jobs:
7372
- name: Deploy to ephemerals - Branch SC
7473
if: startsWith(github.ref, 'refs/heads/sc-')
7574
run: |
76-
aws s3 sync build/dev s3://aplazame-ephemeral-environments/sc-${{ env.BRANCH_NAME }}-${{ env.APP }}-dev --acl public-read --cache-control "private, max-age:3600" --delete
77-
aws s3 cp build/dev s3://aplazame-ephemeral-environments/sc-${{ env.BRANCH_NAME }}-${{ env.APP }}-dev --recursive --exclude '*' --include '*.html' --acl public-read --cache-control 'no-cache, no-store'
75+
aws s3 sync build/staging s3://ephemeral-environments/${{ env.APP }}${{ env.BRANCH_NAME }} --acl public-read --cache-control "private, max-age:3600" --delete
76+
aws s3 cp build/staging s3://ephemeral-environments/${{ env.APP }}/${{ env.BRANCH_NAME }} --recursive --exclude '*' --include '*.html' --acl public-read --cache-control 'no-cache, no-store'
7877

0 commit comments

Comments
 (0)