ci(*): add www-redirect app and deploy logic #135
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 | |
on: | |
pull_request: | |
branches: [main] | |
workflow_call: | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Wasm Rust target | |
run: | | |
rustup target add wasm32-wasi | |
- name: Install wasi-vfs | |
run: | | |
curl -LOs https://github.com/kateinoigakukun/wasi-vfs/releases/download/v0.4.0/wasi-vfs-cli-x86_64-unknown-linux-gnu.zip | |
unzip wasi-vfs-cli-x86_64-unknown-linux-gnu.zip | |
mv wasi-vfs /usr/local/bin | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'redirect/go.mod' | |
- name: Install tinygo | |
run: | | |
wget https://github.com/tinygo-org/tinygo/releases/download/v0.27.0/tinygo_0.27.0_amd64.deb | |
sudo dpkg -i tinygo_0.27.0_amd64.deb | |
- name: Install Spin | |
uses: fermyon/actions/spin/setup@v1 | |
with: | |
version: v2.7.0 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: site/package-lock.json | |
- name: Install npm dependencies for site | |
working-directory: site | |
run: npm ci | |
- name: Install npm dependencies for sessionv2 | |
working-directory: sessionv2 | |
run: npm ci | |
- name: Build | |
env: | |
ENABLE_WASM_OPT: false | |
run: | | |
make build | |
- name: Test site | |
env: | |
TIMEOUT: 1m | |
run: | | |
make test-server | |
- name: Archive app artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app | |
path: | | |
spin.toml | |
components/*.wasm | |
site/dist/ | |
highscore/migration.sql |