deploy-marimo-wasm #262
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
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. | |
name: deploy-marimo-wasm | |
permissions: | |
contents: read | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
# Trigger the workflow when: | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
schedule: | |
# Hack for now since we can't trigger off events in the marimo fork. Deploys every hour | |
- cron: '0 * * * *' | |
jobs: | |
build-deploy: | |
# NOTE: This name appears in GitHub's Checks API. | |
name: build-deploy | |
environment: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout oso marimo repository fork | |
uses: actions/checkout@v4 | |
with: | |
repository: opensource-observer/marimo | |
fetch-depth: 1 | |
- uses: prefix-dev/setup-pixi@v0.9.0 | |
with: | |
cache: true | |
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: | | |
- recursive: true | |
args: [--frozen-lockfile, --strict-peer-dependencies] | |
- name: Set up Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
cache: "pnpm" | |
node-version: "22.x" | |
- name: Build the frontend components | |
run: pixi run make fe | |
- name: Build the dist directory for marimo | |
run: pixi run bash scripts/build_marimo_static_dist.sh marimo_dist marimo.opensource.observer | |
- name: Create _redirects file for Cloudflare Pages | |
run: | | |
echo "/notebook/api/* https://www.opensource.observer/api/v1/marimo/:splat 307" > marimo_dist/_redirects | |
- name: Install wrangler | |
run: pnpm add -g wrangler | |
- name: Publish | |
run: wrangler pages deploy marimo_dist --project-name=marimo | |
# - name: Publish | |
# uses: cloudflare/wrangler-action@v3 | |
# with: | |
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
# workingDirectory: "apps/docs" | |
# command: pages deploy build --project-name=docs-opensource-observer |