Publish data to npm #13
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 data to npm | |
on: | |
schedule: | |
- cron: "0 0 * * MON" | |
push: | |
branches: | |
- master | |
paths: | |
- "packages/es-scraper/**" | |
workflow_dispatch: {} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
environment: Publish | |
defaults: | |
run: | |
working-directory: ./packages/es-scraper | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: yarn | |
- run: yarn install | |
- run: yarn build | |
- name: Publish to npm | |
run: | | |
npm whoami | |
yarn version patch | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Push new version | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "chore: publish new version [skip ci]" | |
git push |