chore(deps-dev): bump vite from 8.0.11 to 8.0.16 #561
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 to Cloudflare Pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: "Choose an environment to deploy to: <preview|production>" | |
| required: true | |
| default: "preview" | |
| pull_request: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }} | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: "yarn" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Sync playground bundles | |
| run: yarn build:sync-bundles | |
| - name: Set VITE_DEPLOYMENT_URL | |
| shell: bash | |
| run: | | |
| RAW_BRANCH="${{ github.head_ref || github.ref_name }}" | |
| if [[ "$RAW_BRANCH" == "master" ]]; then | |
| echo "VITE_DEPLOYMENT_URL=" >> "$GITHUB_ENV" | |
| else | |
| SAFE_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') | |
| SAFE_BRANCH="${SAFE_BRANCH:0:28}" | |
| echo "SAFE_BRANCH=$SAFE_BRANCH" >> "$GITHUB_ENV" | |
| echo "VITE_DEPLOYMENT_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" >> "$GITHUB_ENV" | |
| fi | |
| - name: Build | |
| run: yarn build | |
| env: | |
| VITE_DEPLOYMENT_URL: ${{ env.VITE_DEPLOYMENT_URL }} | |
| VITE_ALGOLIA_APP_ID: ${{ secrets.VITE_ALGOLIA_APP_ID }} | |
| VITE_ALGOLIA_INDEX_NAME: ${{ secrets.VITE_ALGOLIA_INDEX_NAME }} | |
| VITE_ALGOLIA_SEARCH_API_KEY: ${{ secrets.VITE_ALGOLIA_SEARCH_API_KEY }} | |
| - name: Deploy | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: apps/docs | |
| command: pages deploy out --project-name=rescript-lang-org --branch=${{ env.SAFE_BRANCH }} | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| wranglerVersion: 4.85.0 | |
| env: | |
| FORCE_COLOR: 0 | |
| - name: Comment PR with deployment link | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| recreate: true | |
| header: deploymemt | |
| message: | | |
| ## Cloudflare deployment | |
| Deployement ID: ${{ steps.deploy.outputs.pages-deployment-id }} | |
| Deployment Environment: ${{ steps.deploy.outputs.pages-environment }} | |
| ${{ steps.deploy.outputs.command-output }} | |
| deploy-guide: | |
| runs-on: ubuntu-latest | |
| name: Deploy Guide Worker | |
| if: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }} | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: "yarn" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build guide | |
| run: yarn build:guide | |
| - name: Set guide deployment command | |
| shell: bash | |
| run: | | |
| RAW_BRANCH="${{ github.head_ref || github.ref_name }}" | |
| SAFE_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') | |
| SAFE_BRANCH="${SAFE_BRANCH:0:28}" | |
| if [[ "${{ github.event_name }}" == "push" && "$RAW_BRANCH" == "master" ]] || [[ "${{ inputs.environment }}" == "production" ]]; then | |
| echo "GUIDE_DEPLOY_COMMAND=deploy" >> "$GITHUB_ENV" | |
| else | |
| echo "GUIDE_DEPLOY_COMMAND=versions upload --preview-alias=$SAFE_BRANCH" >> "$GITHUB_ENV" | |
| fi | |
| - name: Deploy guide | |
| id: deploy-guide | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: apps/guide | |
| command: ${{ env.GUIDE_DEPLOY_COMMAND }} | |
| wranglerVersion: 4.85.0 | |
| env: | |
| FORCE_COLOR: 0 | |
| - name: Comment PR with guide deployment link | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| recreate: true | |
| header: guide-deployment | |
| message: | | |
| ## Guide Cloudflare deployment | |
| ${{ steps.deploy-guide.outputs.command-output }} | |
| e2e: | |
| runs-on: ubuntu-latest | |
| name: E2E Tests | |
| needs: deploy | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.3.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: "yarn" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build ReScript | |
| run: yarn build:res | |
| - name: Set Cypress base URL | |
| id: cypress-base-url | |
| shell: bash | |
| run: | | |
| RAW_BRANCH="${{ github.head_ref || github.ref_name }}" | |
| if [[ "$RAW_BRANCH" == "master" ]]; then | |
| CYPRESS_BASE_URL="https://rescript-lang.org" | |
| else | |
| SAFE_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') | |
| SAFE_BRANCH="${SAFE_BRANCH:0:28}" | |
| CYPRESS_BASE_URL="https://${SAFE_BRANCH}.rescript-lang.pages.dev" | |
| fi | |
| echo "url=$CYPRESS_BASE_URL" >> "$GITHUB_OUTPUT" | |
| - name: Cypress E2E tests | |
| uses: cypress-io/github-action@v7 | |
| with: | |
| install: false | |
| working-directory: apps/docs | |
| browser: chrome | |
| config: baseUrl=${{ steps.cypress-base-url.outputs.url }} |