Update main.yaml #51
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: Build and Deploy Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: <span class="math-inline">\{\{ runner\.os \}\}\-build\-</span>{{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
<span class="math-inline">\{\{ runner\.os \}\}\-build\-</span>{{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
cache-invalidation-period: 1d | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Angular app to prod | |
run: npm run build:prod | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.TOKEN_GIT}} | |
folder: dist/browser | |
branch: gh-pages |