Skip to content

DevHub Frontend CICD #130

DevHub Frontend CICD

DevHub Frontend CICD #130

Workflow file for this run

name: DevHub Frontend CICD
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
name: Static Frontend Build - nodeJS v${{ matrix.node-version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Static Frontend Build - node v${{ matrix.node-version }}
run: .github/workflows/frontend-build.sh
env:
DEVHUB_BACKEND_API: ${{ secrets.DEVHUB_BACKEND_API }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist-node-${{ matrix.node-version }}
path: frontend/dist.tar.gz
aws:
name: AWS Authentication
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Determine AWS Context
id: aws-context
run: .github/workflows/frontend-aws-context.sh
env:
DEVHUB_FRONTEND_PROD_IAM_ARN: ${{ secrets.DEVHUB_FRONTEND_PROD_IAM_ARN }}
DEVHUB_FRONTEND_RO_IAM_ARN: ${{ secrets.DEVHUB_FRONTEND_RO_IAM_ARN }}
- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: us-east-1
role-to-assume: ${{ steps.aws-context.outputs.role-arn }}
role-duration-seconds: 900
- name: Download Matrix Artifacts
uses: actions/download-artifact@v3
- name: Publish Frontend
run: .github/workflows/frontend-publish.sh
env:
CF_DISTRIBUTION: ${{ secrets.DEVHUB_FRONTEND_PROD_CF_DISTRIBUTION }}
DRY_RUN: ${{ steps.aws-context.outputs.dry-run }}
S3_BUCKET: ${{ secrets.DEVHUB_FRONTEND_PROD_S3_BUCKET }}