Workflow file for this run
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: Build and Publish React Toggle | |
| on: | |
| release: | |
| types: [released] | |
| env: | |
| DESIRED_NODE_VERSION: "22.17.0" | |
| DESIRED_PNPM_VERSION: "10.13.1" | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| concurrency: build-and-deploy | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.DESIRED_NODE_VERSION }} | |
| - name: PNPM Install | |
| run: npm install -g pnpm@${{ env.DESIRED_PNPM_VERSION }} | |
| - uses: actions/cache@v3 | |
| id: pnpm-cache | |
| with: | |
| path: '/home/runner/.local/share/pnpm/store/v3' | |
| key: ${{ runner.os }}-modules-${{ hashFiles('pnpm-lock.yaml') }}-${{ env.DESIRED_NODE_VERSION }}-${{ env.DESIRED_PNPM_VERSION }} | |
| - name: Install pnpm dependencies | |
| run: | | |
| pnpm install --production=false --frozen-lockfile | |
| - name: Run build | |
| run: pnpm run build | |
| - uses: actions/setup-node@v3 | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| # NOTE: | |
| # By default NPM access tokens expire after a year, and so these will need to be updated when the build starts to fail. | |
| - name: Publish | |
| run: pnpm publish --access public --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} |