feat: add multi-profile support with per-profile endpoint overrides #350
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: Publish preview | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - labeled | |
| - unlabeled | |
| paths-ignore: | |
| - '**/*.md' | |
| branches-ignore: | |
| - 'release-please--**' | |
| concurrency: | |
| group: preview-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| env: | |
| CC_CLEVER_TOOLS_PREVIEWS_CELLAR_BUCKET: ${{ vars.CC_CLEVER_TOOLS_PREVIEWS_CELLAR_BUCKET }} | |
| CC_CLEVER_TOOLS_PREVIEWS_CELLAR_KEY_ID: ${{ secrets.CC_CLEVER_TOOLS_PREVIEWS_CELLAR_KEY_ID }} | |
| CC_CLEVER_TOOLS_PREVIEWS_CELLAR_SECRET_KEY: ${{ secrets.CC_CLEVER_TOOLS_PREVIEWS_CELLAR_SECRET_KEY }} | |
| jobs: | |
| build: | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| version: ${{ github.event.pull_request.head.ref }} | |
| isPreview: true | |
| include-windows: ${{ contains(github.event.pull_request.labels.*.name, 'build:win') }} | |
| publish: | |
| needs: build | |
| name: 'Publish preview' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-node | |
| - uses: ./.github/actions/download-artifacts | |
| with: { pattern: build-* } | |
| - name: 'Publish preview' | |
| run: ./scripts/preview.js publish ${{ github.event.pull_request.head.ref }} | |
| - name: 'Prepare PR comment' | |
| id: preview-links | |
| run: | | |
| echo "links<<EOF" >> $GITHUB_OUTPUT | |
| ./scripts/preview.js pr-comment ${{ github.event.pull_request.head.ref }} >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: 'Add comment with preview links to PR' | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| message: ${{ steps.preview-links.outputs.links }} |