From 8dc1255170dbc6d3302c51c38c8f084642462ff1 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Fri, 13 Dec 2024 12:27:52 -0500 Subject: [PATCH] chore: add gh pages example (#3157) --- .github/workflows/pages.yml | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000000..b03e157f40f --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,70 @@ +name: GitHub Pages + +on: + # Weekly + schedule: + - cron: '0 0 * * 0' # Run at midnight UTC on Sunday + + # Allow manual trigger + workflow_dispatch: {} + +env: + UV_SYSTEM_PYTHON: 1 + +jobs: + export-notebooks: + runs-on: ubuntu-latest + + permissions: + pull-requests: write + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🚀 Install uv + uses: astral-sh/setup-uv@v4 + + - name: 🐍 Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: 📦 Install marimo + run: | + uv pip install marimo + + - name: 🛠️ Run export + run: | + marimo export html-wasm frontend/public/files/wasm-intro.py -o out --mode edit + + - name: 📄 List changed files + continue-on-error: true + run: | + echo "Changed files:" + git diff --name-only HEAD^ HEAD + + - name: 📦 Upload Pages Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: out + + deploy: + needs: export-notebooks + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + permissions: + pages: write + id-token: write + + steps: + - name: 🌐 Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + with: + artifact_name: github-pages