This repository has been archived by the owner on Aug 20, 2023. It is now read-only.
CI / CD for Angular #262
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI / CD for Angular | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- evaluation-ui/** | |
workflow_run: | |
workflows: [Download logs for analysis] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
cache-dependency-path: | | |
evaluation/yarn.lock | |
evaluation-ui/yarn.lock | |
- name: Install dependencies for evaluation | |
run: yarn --frozen-lockfile | |
working-directory: evaluation | |
- name: Extract information from logs | |
run: npx ts-node-esm ./src/extractTestInformation.ts | |
working-directory: evaluation | |
- name: Install dependencies for angular | |
run: yarn --frozen-lockfile | |
working-directory: evaluation-ui | |
- name: Build Angular | |
run: yarn build:pages | |
working-directory: evaluation-ui | |
- name: Copy index to 404 | |
run: cp dist/evaluation-ui/index.html dist/evaluation-ui/404.html | |
working-directory: evaluation-ui | |
- name: Upload GitHub Pages artifact | |
uses: actions/[email protected] | |
with: | |
path: evaluation-ui/dist/evaluation-ui | |
deploy: | |
# Add a dependency to the build job | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |