Nightly #207
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: Rust | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 16.x ] | |
steps: # Setting up SSH key | |
- name: Get SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_CAVE }} | |
known_hosts: 'placeholder' | |
# Adding hosts for CD | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H ${{ secrets.CAVE_IP }} >> ~/.ssh/known_hosts | |
# Install the needed rust toolchain | |
- name: Add toolchain | |
run: rustup toolchain install --profile minimal nightly-x86_64-unknown-linux-gnu | |
# Prepares rustup for wasm compiler | |
- name: Add wasm-target | |
run: rustup target add wasm32-unknown-unknown | |
# Pulls in git dependencies | |
- uses: actions/checkout@v3 | |
- name: Pull git depends | |
run: git submodule update --init --recursive --remote | |
# Prepares bun | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
# Load NPM cache | |
- name: Pull node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
# Loads NPM modules for webpack | |
- name: Install NPM depends | |
run: bun install | |
# Loads sass from NPM | |
- name: Install sass | |
run: bun install -g sass | |
# Loads cargo cache | |
- uses: actions/cache@v3 | |
name: Pull Cargo cache | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# Builds wasm setup | |
- name: Build | |
run: cargo build --release --target wasm32-unknown-unknown | |
# Finishes bundle | |
- name: Bundle + Build | |
run: bun run build | |
# Get goatcounter js for self hosting | |
- name: Download count.js | |
run: wget "https://gc.zgo.at/count.js" -P dist/ | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist # The folder the action should deploy. |