Skip to content

Build index

Build index #81

Workflow file for this run

name: Build index
on:
workflow_dispatch:
schedule:
- cron: "10 0 * * *"
jobs:
build:
name: Build index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "main"
submodules: "recursive"
- name: "Build index"
run: |
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml books -d /tmp/books.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml lints -d /tmp/lints.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml labels -d /tmp/labels.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml rustc -d /tmp/rustc.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml targets -d /tmp/targets.js
git clone --depth 1 https://github.com/jplatte/caniuse.rs.git /tmp/caniuse
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml caniuse -p /tmp/caniuse -d /tmp/caniuse.js
git clone --depth 1 https://github.com/nrc/rfc-index.git /tmp/rfc-index
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml rfcs -p /tmp/rfc-index -d /tmp/rfcs.js
wget https://static.crates.io/db-dump.tar.gz -O /tmp/db-dump.tar.gz
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=rust/Cargo.toml --release crates -p /tmp/db-dump.tar.gz -d /tmp/crates.js
cp /tmp/*.js lib/index
zip /tmp/index.zip /tmp/*.js
npm install && npm run build
- name: "Upload Index Artifact"
uses: actions/upload-artifact@master
with:
name: index.zip
path: /tmp/index.zip
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: query-rs
directory: .svelte-kit/cloudflare
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# By default this will be the branch which triggered this workflow
branch: main
# Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
wranglerVersion: "3"