Skip to content

Commit a7e0b77

Browse files
authored
Add GitHub Actions workflow for Dioxus app deployment
1 parent 73c6234 commit a7e0b77

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Dioxus app to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ deploy ] # or your default branch
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
24+
- name: Install Dioxus CLI
25+
run: cargo install dioxus-cli --locked
26+
27+
- name: Build Dioxus Web App
28+
run: dx build --release
29+
30+
- name: Upload artifact
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: target/dioxus/release/web
34+
35+
deploy:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)