Merge pull request #7 from no-witness-labs/fix/deploy-docs-3 #10
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org/' | |
| - id: cached-build-artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: packages/*/dist | |
| key: build-artifacts-${{ github.sha }} | |
| - id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| docs/node_modules | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-modules- | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| # Always run install to ensure all dependencies are available | |
| # This ensures workspace packages like docs have their dependencies | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm turbo run build | |
| if: steps.cached-build-artifacts.outputs.cache-hit != 'true' | |
| - id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm changeset-publish | |
| title: "ci(changesets): version packages" | |
| commit: "ci(changesets): version packages" | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |