chore(ci): simplify install command #62
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: Publish Node.js Package | |
on: | |
push: | |
branches: master | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
deployments: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- uses: actions/setup-node@v4 | |
with: | |
cache: "npm" | |
node-version-file: ".nvmrc" | |
- name: Install app dependencies | |
run: npm ci | |
- run: npm run build | |
- uses: chrnorm/deployment-action@releases/v2 | |
name: Create GitHub deployment | |
id: deployment | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
description: Production builded from ${{ github.sha }} because of ${{ github.event_name }} by ${{ github.actor }} | |
environment-url: https://www.npmjs.com/package/ridermansb | |
- name: Semantic Release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: npm run release | |
- name: Update deployment status (success) | |
if: success() | |
uses: chrnorm/deployment-status@releases/v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
state: "success" | |
deployment-id: ${{ steps.deployment.outputs.deployment_id }} | |
environment-url: https://www.npmjs.com/package/ridermansb | |
- name: Update deployment status (failure) | |
if: failure() | |
uses: chrnorm/deployment-status@releases/v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
state: "failure" | |
deployment-id: ${{ steps.deployment.outputs.deployment_id }} | |
environment-url: https://www.npmjs.com/package/ridermansb |