diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..15286a4 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,45 @@ +name: Docs + +on: + push: + branches: + - main + - master + - stable* + +permissions: + contents: write + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v2 + id: versions + with: + fallbackNode: '^14' + fallbackNpm: '^7' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v3 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies & build + run: | + npm ci + npm run build:doc --if-present + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: dist/doc