Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rupeshtiwari/c062101984b3dea4e953f5698ed09be2 to your computer and use it in GitHub Desktop.
Save rupeshtiwari/c062101984b3dea4e953f5698ed09be2 to your computer and use it in GitHub Desktop.
build angular app with github actions.yml
name: Angular GitHub CI
on:
push:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# caching node_modules
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
npm ci
- name: Build
run: |
npm run build -- --prod
- name: Lint
run: |
npm run lint
- name: Test
run: |
npm run test -- --prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment