Skip to content

NPM Auto Update

NPM Auto Update #43

Workflow file for this run

name: NPM Auto Update
on:
schedule:
- cron: "0 0 */3 * *" # Every 2 days
workflow_dispatch:
jobs:
release:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: latest
run_install: |
args: [--no-frozen-lockfile, --strict-peer-dependencies]
- run: mkdir ./data && git fetch origin && git --work-tree=./data checkout origin/gh-pages -- . && git reset
- id: shouldContinue
run: pnpx tsx src/checkNeedsPublish.ts
- run: echo $OUTPUT
env:
OUTPUT: ${{ steps.shouldContinue.outputs.shouldContinue }}
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: pnpx zardoy-release npm --auto-update
if: steps.shouldContinue.outputs.shouldContinue == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: peaceiris/actions-gh-pages@v3
if: steps.shouldContinue.outputs.shouldContinue == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: data
force_orphan: true