Merge pull request #2816 from rainlanguage/ui-components-render-harness #488
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: GitHub Actions Vercel Production Deployment | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| Deploy-Docs-Preview: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| runs-on: ubuntu-latest | |
| env: | |
| COMMIT_SHA: ${{ github.sha }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free disk space | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| - uses: nixbuild/nix-quick-install-action@v30 | |
| with: | |
| nix_conf: | | |
| keep-env-derivations = true | |
| keep-outputs = true | |
| - uses: cachix/cachix-action@v15 | |
| continue-on-error: true | |
| with: | |
| name: rainlanguage | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| useDaemon: false | |
| - name: Restore and save Nix store | |
| uses: nix-community/cache-nix-action@v7 | |
| with: | |
| primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} | |
| restore-prefixes-first-match: nix-${{ runner.os }}- | |
| gc-max-store-size-linux: 8G | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| # Shared across the docs preview/prod workflows so a preview run (off | |
| # main) restores the cache the prod run saves on main. | |
| prefix-key: rust-vercel-docs | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: npm-${{ runner.os }}-${{ github.workflow }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: npm-${{ runner.os }}- | |
| - run: | | |
| nix develop .#wasm-shell -c bash -c ' | |
| set -euxo pipefail | |
| npm install --no-check | |
| cd packages/raindex | |
| npm run build | |
| npm run docs | |
| ' | |
| - name: Prepare Vercel build output | |
| run: | | |
| OUTPUT_DIR="packages/raindex/.vercel/output" | |
| mkdir -p "${OUTPUT_DIR}/static" | |
| cp -r packages/raindex/docs/* "${OUTPUT_DIR}/static/" | |
| echo '{ "version": 3 }' > "${OUTPUT_DIR}/config.json" | |
| - name: Install Vercel CLI | |
| run: npm install --global vercel@latest | |
| - name: Pull Vercel Environment Information | |
| run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Deploy Project Artifacts to Vercel | |
| run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} packages/raindex | |
| # forwards status to telegram chat if this ci fails or gets canceled, only runs for default branch | |
| - name: Forward CI Status | |
| if: always() | |
| uses: rainlanguage/github-chore/.github/actions/telegram-status-report@main | |
| with: | |
| status: ${{ job.status }} | |
| telegram-bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
| telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }} |