chore: format #7
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
| # Create "installable" preview branches | |
| # | |
| # Commits to `dev` push builds to a `preview/dev` branch: | |
| # pnpm install "remix-run/react-router#preview/dev&path:packages/react-router" | |
| # | |
| # Can also be dispatched manually with base/installable branches to provide | |
| # `experimental` branches from PRs or otherwise. | |
| name: Preview Build | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| inputs: | |
| baseBranch: | |
| description: Base Branch | |
| required: true | |
| installableBranch: | |
| description: Installable Branch | |
| required: true | |
| concurrency: | |
| # Include `event_name` here because when a pull_request is merged (closed), the | |
| # `github.ref` goes back to `ref/heads/dev` which will conflict with the run on | |
| # `dev` from the merged PR | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| preview: | |
| if: github.repository == 'remix-run/react-router' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (push) | |
| if: github.event_name == 'push' | |
| uses: actions/checkout@v4 | |
| - name: Checkout (workflow_dispatch) | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.baseBranch }} | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: "package.json" | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Setup git | |
| run: | | |
| git config --local user.email "hello@remix.run" | |
| git config --local user.name "Remix Run Bot" | |
| # Build and force push over the preview/dev branch | |
| - name: Build/push branch (push) | |
| if: github.event_name == 'push' | |
| run: | | |
| pnpm run setup-installable-branch preview/dev | |
| git push --force --set-upstream origin preview/dev | |
| echo "💿 pushed installable branch: https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)" | |
| # Build and normal push for experimental releases to avoid unintended force | |
| # pushes over remote branches in case of a branch name collision | |
| - name: Build/push branch (workflow_dispatch) | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| pnpm run setup-installable-branch ${{ inputs.installableBranch }} | |
| git push --set-upstream origin ${{ inputs.installableBranch }} | |
| echo "💿 pushed installable branch: https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)" |