Skip to content

Commit

Permalink
Update main.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
tauisilva committed Mar 20, 2024
1 parent b1090cc commit 6476a87
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,47 @@ on:
push:
branches:
- main
pull_request:
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 i && npm run build:prod
run: npm run build:prod

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist/browser
branch: prod
token: ${{ secrets.TOKEN_GIT}}
folder: dist/browser
branch: gh-pages

0 comments on commit 6476a87

Please sign in to comment.