Skip to content

Feature deployment

Feature deployment #18

Workflow file for this run

name: CD for frontend
on:
pull_request:
branches:
- test-pipeline
paths:
- 'frontend/**'
jobs:
cd:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Cache node_modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
- name: Install dependencies
run: npm install
- name: Generate environment.ts
run: |
chmod +x ./generate-environment.sh
./generate-environment.sh
env:
OIDC_CLIENT_ID: ${{ secrets.OIDC_CLIENT_ID }}
API_URL: ${{ secrets.API_URL }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
- name: Run ng build
run: npm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Sync to S3
run: aws s3 sync "./dist/fleet-assistant/browser" "s3://fleet-assistant-hosting-bucket/"