From d14049d87e8e1202a025e5965c52d21ed8f44d24 Mon Sep 17 00:00:00 2001 From: Killer069 <65385476+killer069@users.noreply.github.com> Date: Fri, 19 Nov 2021 12:16:26 +0530 Subject: [PATCH] Added workflow --- .github/workflows/main.yml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f3d946e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,57 @@ +# This is a basic workflow to help you get started with Actions + +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 + - 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 + uses: EndBug/add-and-commit@v7 + with: + cwd: ./docs + default_author: github_actions + message: "Automated docs update"