Release #1302
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| # Release on demand only | |
| on: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # This environment contains secrets needed for publishing | |
| environment: release | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| # Don't save creds in the git config (so it's easier to override later) | |
| persist-credentials: false | |
| - name: Install Node.js from .nvmrc | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - run: yarn --frozen-lockfile | |
| - run: yarn checkchange | |
| - run: yarn lage build test | |
| - name: Set git user | |
| run: | | |
| git config user.email "[email protected]" | |
| git config user.name "Ken Chau" | |
| - name: Release | |
| run: | | |
| # Get the existing remote URL without creds, and use a trap (like try/finally) | |
| # to restore it after this step finishes | |
| trap "git remote set-url origin '$(git remote get-url origin)'" EXIT | |
| # Add a token to the remote URL for auth during release | |
| git remote set-url origin "https://[email protected]/$GITHUB_REPOSITORY" | |
| yarn release -y -n "$NPM_AUTHTOKEN" | |
| env: | |
| NPM_AUTHTOKEN: ${{ secrets.NPM_AUTHTOKEN }} | |
| REPO_PAT: ${{ secrets.REPO_PAT }} | |
| # The docs have a separate installation using Node 22 due to needing newer dependencies | |
| docs: | |
| name: build docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: docs/.nvmrc | |
| - name: Install docs dependencies | |
| working-directory: docs | |
| run: yarn --immutable | |
| - name: Build doc site | |
| working-directory: docs | |
| run: yarn build | |
| - name: Upload site as artifact | |
| id: deployment | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4 | |
| with: | |
| path: docs/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: docs | |
| permissions: | |
| # to deploy to Pages | |
| pages: write | |
| # to verify the deployment originates from an appropriate source | |
| id-token: write | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |