diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d852112..e27dbdd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: build: name: Build runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -28,8 +28,11 @@ jobs: run: git add src && git diff-index --cached HEAD --exit-code src - run: pnpm circular - run: pnpm docgen - - name: Check docs state - run: git add docs && git diff-index --cached HEAD --exit-code docs + - name: Upload pages artifact + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/upload-pages-artifact@v2 + with: + path: docs/ - name: Create Release Pull Request or Publish if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: changesets/action@v1 @@ -38,3 +41,19 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + deploy: + name: Deploy + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: build + permissions: + pages: write # To deploy to GitHub Pages + id-token: write # To verify the deployment originates from an appropriate source + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2