deploy-github-page #30
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: deploy-github-page | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build-web: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2024-01-01 | |
- name: Install Dependencies | |
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libgtk-3-dev protobuf-compiler | |
- name: Install trunk | |
uses: jetli/trunk-action@v0.4.0 | |
with: | |
version: "latest" | |
- name: Add wasm target | |
run: | | |
rustup target add wasm32-unknown-unknown | |
- name: Checkout Tibia Client Repository | |
uses: actions/checkout@v4 | |
with: | |
repository: dudantas/tibia-client | |
path: tibia-client | |
- name: Copy Tibia Client Assets | |
run: | | |
cp -r tibia-client/assets apps/ryot_compass/assets/tibia-catalog | |
cargo run --release --bin ryot_assets_cli extract | |
rm -rf apps/ryot_compass/assets/tibia-catalog | |
- name: Build Compass Release | |
working-directory: ./apps/ryot_compass | |
run: | | |
trunk build --release --public-url "/${GITHUB_REPOSITORY#*/}/" | |
- name: optimize Wasm | |
uses: NiklasEi/wasm-opt-action@v2 | |
with: | |
file: apps/ryot_compass/dist/*.wasm | |
- name: Copy generated assets to dist folder | |
working-directory: ./apps/ryot_compass | |
run: | | |
cp -r assets/* dist/assets/ | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4.2.5 | |
with: | |
branch: gh-pages | |
folder: apps/ryot_compass/dist |