|
23 | 23 | buildoptions: "--pull" |
24 | 24 | tags: "${{ env.GITHUB_REF_SLUG }}" |
25 | 25 |
|
26 | | - build_frontend_master_production: |
| 26 | + build_frontend_master_production_docker: |
27 | 27 | runs-on: ubuntu-latest |
28 | 28 | steps: |
29 | 29 | - uses: actions/checkout@v2 |
|
38 | 38 | password: ${{ secrets.DOCKER_PASSWORD }} |
39 | 39 | buildoptions: "--pull" |
40 | 40 | tags: "${{ env.GITHUB_REF_SLUG }}" |
| 41 | + build_frontend_master_production: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + defaults: |
| 44 | + run: |
| 45 | + working-directory: ./frontend |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - name: Configure AWS Credentials |
| 49 | + uses: aws-actions/configure-aws-credentials@v1 |
| 50 | + with: |
| 51 | + aws-access-key-id: ${{ secrets.VOXEET_AWS_ACCESS_KEY_ID }} |
| 52 | + aws-secret-access-key: ${{ secrets.VOXEET_AWS_SECRET_ACCESS_KEY }} |
| 53 | + aws-region: ${{ secrets.VOXEET_AWS_REGION }} |
| 54 | + - name: Set NPM token when logging to CodeArtifact |
| 55 | + run: | |
| 56 | + CODEARTIFACT_TOKEN=$(/usr/local/bin/aws codeartifact get-authorization-token --duration-seconds 1800 --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_DOMAIN_OWNER }} --region ${{ secrets.AWS_REGION }} --output text --query authorizationToken) |
| 57 | + echo "::add-mask::$CODEARTIFACT_TOKEN" |
| 58 | + echo "CUSTOM_REGISTRY_TOKEN=${{ secrets.CODEARTIFACT_NPM_RELEASES_REPOSITORY_TOKEN }}$CODEARTIFACT_TOKEN" >> $GITHUB_ENV |
| 59 | + - name: build frontend for master - production Web SDK |
| 60 | + uses: actions/setup-node@v2 |
| 61 | + env: |
| 62 | + CUSTOM_REGISTRY_URL: ${{ secrets.CODEARTIFACT_NPM_RELEASES_REPOSITORY_URL }} |
41 | 63 |
|
42 | | - build_frontend_master_staging: |
| 64 | + with: |
| 65 | + node-version: "16.9.1" |
| 66 | + - run: | |
| 67 | + npm config set registry=${{ secrets.CODEARTIFACT_NPM_RELEASES_REPOSITORY_URL }} |
| 68 | + npm config set $CUSTOM_REGISTRY_TOKEN |
| 69 | + npm config set always-auth true |
| 70 | + yarn add -E @voxeet/voxeet-web-sdk@${{ env.GITHUB_REF_SLUG }} |
| 71 | + yarn install |
| 72 | + yarn build |
| 73 | + - name: publish frontend for frontend master Web SDK |
| 74 | + uses: jakejarvis/s3-sync-action@master |
| 75 | + env: |
| 76 | + AWS_S3_BUCKET: dlb-capi-showcase |
| 77 | + AWS_ACCESS_KEY_ID: ${{ secrets.VOXEET_AWS_ACCESS_KEY_ID }} |
| 78 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.VOXEET_AWS_SECRET_ACCESS_KEY }} |
| 79 | + AWS_REGION: ${{ secrets.VOXEET_AWS_REGION }} |
| 80 | + SOURCE_DIR: "frontend/dist" |
| 81 | + DEST_DIR: ${{ env.GITHUB_REF_SLUG }} |
| 82 | + - name: invalidate cloudfront distribution paths |
| 83 | + uses: chetan/invalidate-cloudfront-action@v2 |
| 84 | + env: |
| 85 | + DISTRIBUTION: E5A6FYRYTC8IV |
| 86 | + PATHS: "/${{ env.GITHUB_REF_SLUG }}/*" |
| 87 | + AWS_REGION: ${{ secrets.VOXEET_AWS_REGION }} |
| 88 | + AWS_ACCESS_KEY_ID: ${{ secrets.VOXEET_AWS_ACCESS_KEY_ID }} |
| 89 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.VOXEET_AWS_SECRET_ACCESS_KEY }} |
| 90 | + |
| 91 | + build_frontend_master_staging_docker_image: |
43 | 92 | runs-on: ubuntu-latest |
44 | 93 | steps: |
45 | 94 | - uses: actions/checkout@v2 |
@@ -76,3 +125,53 @@ jobs: |
76 | 125 | buildargs: CUSTOM_REGISTRY_URL,CUSTOM_REGISTRY_TOKEN,WEB_SDK_DIST_TAG |
77 | 126 | buildoptions: "--pull" |
78 | 127 | tags: "${{ env.WEB_SDK_DIST_TAG }}" |
| 128 | + |
| 129 | + build_frontend_master_staging: |
| 130 | + runs-on: ubuntu-latest |
| 131 | + defaults: |
| 132 | + run: |
| 133 | + working-directory: ./frontend |
| 134 | + steps: |
| 135 | + - uses: actions/checkout@v2 |
| 136 | + - name: Configure AWS Credentials |
| 137 | + uses: aws-actions/configure-aws-credentials@v1 |
| 138 | + with: |
| 139 | + aws-access-key-id: ${{ secrets.VOXEET_AWS_ACCESS_KEY_ID }} |
| 140 | + aws-secret-access-key: ${{ secrets.VOXEET_AWS_SECRET_ACCESS_KEY }} |
| 141 | + aws-region: ${{ secrets.VOXEET_AWS_REGION }} |
| 142 | + - name: Set NPM token when logging to CodeArtifact |
| 143 | + run: | |
| 144 | + CODEARTIFACT_TOKEN=$(/usr/local/bin/aws codeartifact get-authorization-token --duration-seconds 1800 --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_DOMAIN_OWNER }} --region ${{ secrets.AWS_REGION }} --output text --query authorizationToken) |
| 145 | + echo "::add-mask::$CODEARTIFACT_TOKEN" |
| 146 | + echo "CUSTOM_REGISTRY_TOKEN=${{ secrets.CODEARTIFACT_NPM_RELEASES_REPOSITORY_TOKEN }}$CODEARTIFACT_TOKEN" >> $GITHUB_ENV |
| 147 | + - name: build frontend for develop - frontend master_staging Web SDK |
| 148 | + uses: actions/setup-node@v2 |
| 149 | + env: |
| 150 | + WEB_SDK_DIST_TAG: master-staging |
| 151 | + CUSTOM_REGISTRY_URL: ${{ secrets.CODEARTIFACT_NPM_RELEASES_REPOSITORY_URL }} |
| 152 | + with: |
| 153 | + node-version: "16.9.1" |
| 154 | + - run: | |
| 155 | + npm config set registry=${{ secrets.CODEARTIFACT_NPM_RELEASES_REPOSITORY_URL }} |
| 156 | + npm config set $CUSTOM_REGISTRY_TOKEN |
| 157 | + npm config set always-auth true |
| 158 | + yarn add -E @voxeet/voxeet-web-sdk@${{ env.WEB_SDK_DIST_TAG }} |
| 159 | + yarn install |
| 160 | + yarn build |
| 161 | + - name: publish frontend for frontend master_staging Web SDK |
| 162 | + uses: jakejarvis/s3-sync-action@master |
| 163 | + env: |
| 164 | + AWS_S3_BUCKET: dlb-capi-showcase |
| 165 | + AWS_ACCESS_KEY_ID: ${{ secrets.VOXEET_AWS_ACCESS_KEY_ID }} |
| 166 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.VOXEET_AWS_SECRET_ACCESS_KEY }} |
| 167 | + AWS_REGION: ${{ secrets.VOXEET_AWS_REGION }} |
| 168 | + SOURCE_DIR: "frontend/dist" |
| 169 | + DEST_DIR: ${{ env.WEB_SDK_DIST_TAG }} |
| 170 | + - name: invalidate cloudfront distribution paths |
| 171 | + uses: chetan/invalidate-cloudfront-action@v2 |
| 172 | + env: |
| 173 | + DISTRIBUTION: E5A6FYRYTC8IV |
| 174 | + PATHS: "/${{ env.WEB_SDK_DIST_TAG }}/*" |
| 175 | + AWS_REGION: ${{ secrets.VOXEET_AWS_REGION }} |
| 176 | + AWS_ACCESS_KEY_ID: ${{ secrets.VOXEET_AWS_ACCESS_KEY_ID }} |
| 177 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.VOXEET_AWS_SECRET_ACCESS_KEY }} |
0 commit comments