feat: tui! #115
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # To push a branch | |
pages: write # To push to a GitHub Pages site | |
id-token: write # To update the deployment status | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
target: wasm32-unknown-unknown | |
- name: Install latest mdbook | |
run: | | |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | |
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | |
mkdir mdbook | |
curl -sSL $url | tar -xz --directory=./mdbook | |
echo `pwd`/mdbook >> $GITHUB_PATH | |
- name: Build Book | |
run: | | |
cd book | |
mdbook build | |
- name: Build docs | |
uses: actions-rs/cargo@v1 | |
with: | |
command: doc | |
args: --no-deps --all-features | |
- name: Make dist folder | |
run: | | |
mkdir dist | |
- name: Copy docs | |
run: | | |
mkdir dist/doc | |
cp -r target/doc dist | |
- name: Copy book | |
run: | | |
mkdir dist/book | |
cp -r book/book dist | |
- name: Copy homepage | |
run: | | |
cp book/banner.webp dist/banner.webp | |
cp book/landing.html dist/index.html | |
- name: Download and install Trunk binary | |
working-directory: crates/games-ui | |
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- | |
- name: Build Web App | |
run: ./trunk build --release --public-url $public_url | |
working-directory: crates/games-ui | |
env: | |
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/app" | |
- name: Copy Web App | |
run: | | |
mkdir dist/app | |
cp -r ./crates/games-ui/dist/* dist/app | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: 'dist' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |