Skip to content

Add deploy action

Add deploy action #2

Workflow file for this run

name: "Dioxus Deploy"
author: "YuKun Liu <[email protected]>"
description: "Deploy your dioxus-web app online"
icon: "book"
color: "blue"
inputs:
buildMode:
description: "Build projects using different modes [default: 'release']"
required: true
default: "release"
toolchain:
description: "Build projects using a different rust toolchain [default: 'stable']"
required: true
default: "stable"
outDirectory:
description: "The `out_dir` property configured in Dioxus.toml [default: 'dist']"
required: true
default: "dist"
rootPath:
description: "Source code root path [default: '.']"
required: true
default: "."
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
with:
toolchain: ${{ inputs.toolchain }}
profile: minimal
target: wasm32-unknown-unknown
override: true
- uses: Swatinem/rust-cache@v2
- name: Install Dioxus-CLI
shell: bash
run: cargo install dioxus-cli
- name: Build Project 🎁
shell: bash
run: cd ${{ inputs.rootPath }} && dx build --${{ inputs.buildMode }} && cp ./${{ inputs.outDirectory }}/index.html ./${{ inputs.outDirectory }}/404.html
- name: Deploy Project 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ${{ inputs.rootPath }}/${{ inputs.outDirectory }}
clean: false