2021-11-19 14:43:53 +05:30

57 lines
1.3 KiB
YAML

name: Publish NPM package + Docs
on:
release:
types: [created]
jobs:
publish_npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: npm install
- name: Publish NPM package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: "${{ secrets.DOCS_TOKEN }}"
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Delete the docs directory
run: rm -rf ./docs
- name: Clone docs repository
uses: actions/checkout@v2
with:
repository: play-dl/play-dl.github.io
path: ./docs
token: "${{ secrets.DOCS_TOKEN }}"
- name: Generate docs
run: npx typedoc
- name: Publish docs
run: |
echo $PWD
git add .
git cm 'Automated docs update'
git push
working-directory: docs