diff --git a/.github/workflows/build.docs.yml b/.github/workflows/build.docs.yml new file mode 100644 index 0000000..df338b8 --- /dev/null +++ b/.github/workflows/build.docs.yml @@ -0,0 +1,45 @@ +name: Deploy TypeDoc to GitHub Pages + +on: + push: + branches: + - master + +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + + - name: Install dependencies + run: npm install + + - name: Build Documentation + run: npm run build.docs + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "./docs" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 860184b..82b1207 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,36 +2,19 @@ name: Build on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: npm install, build, test - run: | - npm i - npm run build - npm run test - - git config --global user.email "mrantix@users.noreply.github.com" - git config --global user.name "MrAntix" - - if git show-ref --quiet refs/heads/docs; then - git branch -D docs - fi - - git checkout -b docs - - npm run build.docs - git add -f ./docs - git commit -m"docs: update" + - uses: actions/checkout@v4 - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/mrantix/bind.git - git push origin docs --force - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: npm install, build, test + run: | + npm i + npm run build + npm run test