random refined #141
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
name: Build/Publish/Deploy # https://docs.github.com/en/actions | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest # https://github.com/actions/virtual-environments | |
steps: | |
#- run: rustup update #target add wasm32-unknown-unknown | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
#- uses: swatinem/rust-cache@v2 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
~/.npm | |
node_modules/ | |
package.json | |
package-lock.json | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: cargo-bins/cargo-binstall@main | |
#- uses: taiki-e/install-action@nextest | |
- name: Build Project with Dioxus and TailwindCSS | |
run: | | |
cargo binstall dioxus-cli | |
cargo t --no-default-features #cargo nextest r | |
#cargo r --bin syncd -F syncdep --no-default-features | |
npm install tailwindcss @tailwindcss/cli #-D -g | |
npx tailwindcss -i input.css -o assets/tailwind.css -m | |
dx build -r --platform web #--verbose --trace | |
#- name: Setup GitHub Pages | |
# uses: actions/configure-pages@v4 | |
- name: Upload Artifacts | |
uses: actions/upload-pages-artifact@v3 | |
#env: | |
# REPO_NAME: ${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/} | |
with: # https://github.com/actions/upload-pages-artifact | |
path: target/dx/${{ github.event.repository.name }}/release/web/public | |
# path: target/dx/${{ env.REPO_NAME }}/release/web/public | |
deploy: | |
#if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: # https://github.com/actions/deploy-pages | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 | |
id: deployment | |