Skip to content

MUTATION (not for merge): AddOrder.sender Bytes! -> String! #2952

MUTATION (not for merge): AddOrder.sender Bytes! -> String!

MUTATION (not for merge): AddOrder.sender Bytes! -> String! #2952

name: GitHub Actions Vercel Docs Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }}
on:
push:
branches-ignore:
- main
concurrency:
group: ${{ github.ref }}-vercel-docs-preview
cancel-in-progress: true
jobs:
Deploy-Docs-Preview:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
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:
# Restore this branch's own cache if it has one, else fall back to the
# cache the prod run saves on main (shared prefix-key). save-if keeps
# this branch's cache warm across re-runs.
prefix-key: rust-vercel-docs
save-if: true
- 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 }}-
# Slim docs build: workspace-root npm install (for npm workspaces
# resolution) then build the raindex wasm package and run typedoc.
# Replaces ./prep-all.sh which also did forge install + forge build +
# raindex-prelude + raindex-cli build (none of that is read by typedoc).
- 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=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --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 }}