Update npm-deploy action #20
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: Push checks | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18.17.1" | |
- uses: ./.github/actions/lint | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18.17.1" | |
- uses: ./.github/actions/unit-tests | |
functional-tests: | |
name: Functional Tests | |
runs-on: ubuntu-20.04 | |
needs: ['unit-tests', lint] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18.17.1" | |
- uses: ./.github/actions/functional-tests | |
npm-deploy: | |
name: Publish Package to NPM.js | |
runs-on: ubuntu-20.04 | |
needs: [functional-tests] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: | | |
~/.cache/pip | |
~/.npm | |
**/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 }}- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18.17.1" | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npm run build | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |