Skip to content

Video Lease Channels #248

Video Lease Channels

Video Lease Channels #248

Workflow file for this run

name: AWS S3
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
strategy:
matrix:
target: [COTAK, WFTAK]
include:
- target: COTAK
s3_prod: COTAK_PRODUCTION
s3_staging: COTAK_STAGING
api_url: COTAK_PRODUCTION_API
staging_api_url: COTAK_STAGING_API
- target: WFTAK
s3_prod: WFTAK_PRODUCTION
s3_staging: WFTAK_STAGING
api_url: WFTAK_PRODUCTION_API
staging_api_url: WFTAK_STAGING_API
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: NPM Install
working-directory: ./api/web/
run: npm install
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::${{secrets.AWS_ACCOUNT_ID}}:role/Github-ECR-Builder
role-session-name: GithubECRBuilder
aws-region: ${{secrets.AWS_REGION}}
- name: NPM Build
working-directory: ./api/web/
run: API_URL='${{ secrets[matrix.api_url] }}' npm run builds3
- name: AWS S3 CP
working-directory: ./api/web/
run: aws s3 cp --recursive dist/ s3://${{ secrets[matrix.s3_prod] }}/${{github.event.pull_request.head.sha || github.sha}}/
- name: Clean Dist
working-directory: ./api/web/
run: rm -rf dist/
- name: Configure AWS Credentials (STAGING)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{secrets.AWS_STAGING_ACCOUNT_ID}}:role/Github-ECR-Builder
role-session-name: GithubECRBuilder
aws-region: ${{secrets.AWS_STAGING_REGION}}
- name: NPM Build
working-directory: ./api/web/
run: API_URL='${{ secrets[matrix.staging_api_url] }}' npm run builds3
- name: AWS S3 CP
working-directory: ./api/web/
run: aws s3 cp --recursive dist/ s3://${{ secrets[matrix.s3_staging] }}/${{github.event.pull_request.head.sha || github.sha}}/
- name: Clean Dist
working-directory: ./api/web/
run: rm -rf dist/