diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a0eca3e..2906dc51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,11 @@ jobs: needs: ci runs-on: ubuntu-latest environment: github-pages + permissions: + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_PRIVATE_ACCESS_TOKEN }} - uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@0.6.0 @@ -25,37 +26,51 @@ jobs: name: build path: / - - name: 🔖 Configure publish - env: - NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc - - git config --local user.email "${{ github.actor }}@users.noreply.github.com" - git config --local user.name "${{ github.actor }}" + - uses: googleapis/release-please-action@v4 + with: + release-type: node + skip-github-pull-request: true - name: 📦 Publish NPM packages env: - GH_TOKEN: ${{ secrets.GH_PRIVATE_ACCESS_TOKEN }} - run: | - npx standard-version + NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + run: npm publish --access public - echo `git add -A && git commit -m "chore: prepare release"` - git push --follow-tags origin ${{ github.event.repository.default_branch }} + docs-publish: + name: Publish documentation + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: ci + steps: + - uses: actions/checkout@v4 - npm publish --access public + - uses: actions/download-artifact@v4 + with: + name: build + path: / - - name: 🌐 Publish to gh-pages - run: | + - run: | mkdir -p /tmp cp -R build/docs /tmp/publish cp -R docs /tmp/publish/ - - name: 🌐 Publish Github pages - uses: peaceiris/actions-gh-pages@v4.0.0 + - name: ⚙️ Setup Pages + uses: actions/configure-pages@v5 + + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: /tmp/publish - enable_jekyll: true - user_name: ${{ github.actor }} - user_email: ${{ github.actor }}@users.noreply.github.com + source: ./ + destination: ./_site + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + - name: 🚀 Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4