Created
March 30, 2021 19:13
-
-
Save rupeshtiwari/c062101984b3dea4e953f5698ed09be2 to your computer and use it in GitHub Desktop.
build angular app with github actions.yml
This file contains hidden or 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: 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