Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---

name: Vortex Web

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request:
push:
branches: [develop]

permissions:
contents: read

defaults:
run:
working-directory: vortex-web

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
web: ${{ steps.filter.outputs.web }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
web:
- "vortex-web/**"
- ".github/workflows/web.yml"

build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
enable-sccache: "false"
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
working-directory: .
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: vortex-web/package-lock.json
- run: npm ci
- run: npm run build
- run: npm run lint
- uses: actions/upload-artifact@v4
with:
name: vortex-web-dist
path: vortex-web/dist
retention-days: 7

preview:
name: Deploy Preview
needs: [build, changes]
if: needs.changes.outputs.web == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
deployments: write
environment:
name: preview
url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- uses: actions/download-artifact@v4
with:
name: vortex-web-dist
path: dist
- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: >-
pages deploy dist/
--project-name=vortex-web
--branch=${{ github.head_ref || github.ref_name }}
- name: Comment preview URL on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const body = `**Vortex Web Preview:** ${{ steps.deploy.outputs.deployment-url }}`;
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const existing = comments.find(c =>
c.body?.startsWith('**Vortex Web Preview:**')
);
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ members = [
"vortex-jni",
"vortex-python",
"vortex-tui",
"vortex-web/crate",
"vortex-test/compat-gen",
"vortex-test/e2e-cuda",
"xtask",
Expand Down
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SPDX-FileCopyrightText = "Copyright the Vortex contributors"
SPDX-License-Identifier = "CC-BY-4.0"

[[annotations]]
path = ["**/.gitignore", ".gitmodules", ".python-version", "**/*.lock", "**/*.lockfile", "**/*.toml", "renovate.json", ".idea/**", ".github/**", "codecov.yml", "java/gradle/wrapper/gradle-wrapper.properties"]
path = ["**/.gitignore", ".gitmodules", ".python-version", "**/*.lock", "**/*.lockfile", "**/*.toml", "**/*.json", ".idea/**", ".github/**", "codecov.yml", "java/gradle/wrapper/gradle-wrapper.properties"]
precedence = "override"
SPDX-FileCopyrightText = "Copyright the Vortex contributors"
SPDX-License-Identifier = "Apache-2.0"
Expand Down
4 changes: 4 additions & 0 deletions vortex-web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
src/wasm/pkg
*.local
Loading
Loading