feat(examples): store demo app (Compose Coffee) + the deploy bugs it flushed out #161
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: Preview Release | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "!**" | |
| concurrency: | |
| group: preview-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Skip the whole preview build+publish on inert (docs-only) PRs — there is no | |
| # publishable package change to preview. "Publish preview" is not a required | |
| # status check, so skipping the job does not wedge the merge ruleset. On | |
| # push-to-main the detector reports non-inert, so previews still publish. | |
| changes: | |
| name: Detect inert diff | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| inert: ${{ steps.detect.outputs.inert }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - id: detect | |
| uses: ./.github/actions/detect-inert-diff | |
| preview: | |
| name: Publish preview | |
| needs: changes | |
| if: needs.changes.outputs.inert != 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write # Required for pkg.pr.new to post PR comments | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Collect publishable packages | |
| id: packages | |
| run: | | |
| PACKAGES=$(node scripts/list-publishable-packages.mjs) | |
| { | |
| echo "list<<EOF" | |
| echo "$PACKAGES" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| echo "Packages to publish:" | |
| echo "$PACKAGES" | tr ' ' '\n' | |
| # Requires the pkg.pr.new GitHub App to be installed on the repo | |
| # (https://github.com/apps/pkg-pr-new) — it is. | |
| - name: Publish to pkg.pr.new | |
| run: pnpm exec pkg-pr-new publish --pnpm --comment=update ${{ steps.packages.outputs.list }} |