Merge pull request #66 from flo-bit/changeset-release/main #102
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: Deploy docs | |
| on: | |
| push: | |
| branches: ['main'] | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| name: Build and deploy docs | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Cache turbo build setup | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.30.1 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install latest npm (>= 11.5.1 for trusted publishing) | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm build | |
| env: | |
| BASE_PATH: '/${{ github.event.repository.name }}' | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| # This expects you to have a script called release which does a build for your packages and calls changeset publish | |
| publish: pnpm release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Upload Artifacts | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'apps/docs/build/' | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |