Split workflows and add cache #1
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 | |
"on": | |
push: | |
branches: | |
- main | |
jobs: | |
build-project: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache Node Modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
**/node_modules | |
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}" | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies and Build Project | |
env: | |
FONTAWESOME_NPM_AUTH_TOKEN: "${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" | |
run: | | |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/ | |
npm config set "//npm.fontawesome.com/:_authToken" "${FONTAWESOME_NPM_AUTH_TOKEN}" | |
npm ci | |
npm run build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: aleph-node-metrics-build-artifact | |
path: out/ | |
id: aleph-node-metrics-build-artifact |