Skip to content

Build and deploy

Build and deploy #5

Workflow file for this run

name: webassetstudio-build
run-name: Build and deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# - name: Build main WASM (FUTURE)
# run: wasm-pack build
# TODO: add MojoShader build script when the rewrite is complete
- name: Build encoders
run: cd encoders && wasm-pack build --out-dir ../js/encoders
- name: Install dependencies
run: npm install
- name: Build web
run: npm run build
- name: Install SSH keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: Deploy to server
run: scp -P ${{ secrets.SSH_PORT }} -p ${{ secrets.SSH_PASS }} -r dist ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.WORK_DIR }}/
- name: Cleanup
run: rm -rf ~/.ssh && rm -rf dist