├── README.md ├── .gitignore ├── LICENSE └── action.yml /README.md: -------------------------------------------------------------------------------- 1 | # deploy-action 2 | 3 | > You can use this action autho-deploy your Dioxus web project. 4 | 5 | ```yml 6 | name: github pages 7 | 8 | on: 9 | push: 10 | branches: 11 | - main 12 | 13 | jobs: 14 | build-deploy: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: "Dioxus Deploy" 18 | uses: DioxusLabs/deploy-action@0.1.2 19 | ``` 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build and Release Folders 2 | bin-debug/ 3 | bin-release/ 4 | [Oo]bj/ 5 | [Bb]in/ 6 | 7 | # Other files and folders 8 | .settings/ 9 | 10 | # Executables 11 | *.swf 12 | *.air 13 | *.ipa 14 | *.apk 15 | 16 | # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` 17 | # should NOT be excluded as they contain compiler settings and other important 18 | # information for Eclipse / Flash Builder. 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Dioxus Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Dioxus Deploy" 2 | author: "YuKun Liu " 3 | description: "Deploy your dioxus-web app online" 4 | icon: "book" 5 | color: "blue" 6 | 7 | inputs: 8 | buildMode: 9 | description: "Build projects using different modes [default: 'release']" 10 | required: true 11 | default: "release" 12 | toolchain: 13 | description: "Build projects using a different rust toolchain [default: 'stable']" 14 | required: true 15 | default: "stable" 16 | outDirectory: 17 | description: "The `out_dir` property configured in Dioxus.toml [default: 'dist']" 18 | required: true 19 | default: "dist" 20 | rootPath: 21 | description: "Source code root path [default: '.']" 22 | required: true 23 | default: "." 24 | 25 | runs: 26 | using: "composite" 27 | steps: 28 | - uses: actions/checkout@v3 29 | - uses: actions-rs/toolchain@v1.0.6 30 | with: 31 | toolchain: ${{ inputs.toolchain }} 32 | profile: minimal 33 | target: wasm32-unknown-unknown 34 | override: true 35 | - uses: Swatinem/rust-cache@v2 36 | - name: Install Dioxus-CLI 37 | shell: bash 38 | run: cargo install dioxus-cli 39 | 40 | - name: Build Project 🎁 41 | shell: bash 42 | run: cd ${{ inputs.rootPath }} && dx build --${{ inputs.buildMode }} && cp ./${{ inputs.outDirectory }}/index.html ./${{ inputs.outDirectory }}/404.html 43 | 44 | - name: Deploy Project 🚀 45 | uses: JamesIves/github-pages-deploy-action@v4.4.1 46 | with: 47 | branch: gh-pages 48 | folder: ${{ inputs.rootPath }}/${{ inputs.outDirectory }} 49 | clean: false 50 | --------------------------------------------------------------------------------