-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,46 @@ | ||
name: Deploy Production | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
deployments: write | ||
name: Publish | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
ref: 'main' | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
bun-version: latest | ||
targets: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Setup Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Setup Cargo Binstall | ||
uses: cargo-bins/cargo-binstall@main | ||
|
||
- name: Install Dependencies | ||
run: bun i | ||
- name: Install Rust Binaries | ||
run: | | ||
cargo binstall -y --force trunk | ||
- name: Build Check | ||
env: | ||
NODE_ENV: production | ||
run: bun run build | ||
- name: Build | ||
working-directory: ./crates/www | ||
run: trunk build --release | ||
|
||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/pages-action@1.0.0 | ||
- name: Deploy Client | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} | ||
projectName: ${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }} | ||
directory: ./.svelte-kit/cloudflare | ||
command: pages deploy ./dist --project-name=${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }} | ||
workingDirectory: ./crates/www | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |