Skip to content

Migration - Nx v18 & Angular v17 (#14) #21

Migration - Nx v18 & Angular v17 (#14)

Migration - Nx v18 & Angular v17 (#14) #21

name: lint:test:build:deploy
on:
push:
branches:
- main
- ngx-pass-code
pull_request:
branches:
- main
jobs:
workflow:
runs-on: ubuntu-latest
steps:
- name: Checkout commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- run: pnpm affected:lint:ci
- run: pnpm affected:build:ci
- name: Branch main coverage
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
run: pnpm test:coverage:ci
- name: Branch ngx-pass-code coverage
if: github.ref == 'refs/heads/ngx-pass-code'
run: pnpm ngx-pass-code:test:ci
- name: Coveralls GitHub Action
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main' || github.ref == 'refs/heads/ngx-pass-code'
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Playground app
if: github.ref == 'refs/heads/main'
run: pnpm playground:build:prod
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist/apps/playground/
commit_message: Deploy on GitHub Pages