Merge branch 'main' of https://github.com/dineeek/ngx-libs-workspace #31
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: 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 --no-frozen-lockfile | |
- name: Check for Affected Projects | |
uses: 2coo/action-nx-affected@v1 | |
id: checkForAffected | |
- if: steps.checkForAffected.outputs.hasAffected == 'true' | |
name: Lint affected | |
run: pnpm affected:lint --base=${{ github.base_ref }} --head=${{ github.head_ref }} --plain | |
- if: steps.checkForAffected.outputs.hasAffected == 'true' | |
name: Build affected | |
run: pnpm affected:build --target=build --base=${{ github.base_ref }} --head=${{ github.head_ref }} --plain | |
- 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 |