fix(CI/CD): fix CI builds (#24) #17
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 to Fly on push to main | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install Nix packages | |
uses: DeterminateSystems/nix-installer-action@main | |
- name: Cache Nix packages | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Cache rust dependencies and build output | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Rust Setup | |
run: | | |
nix-shell --run "rustup default nightly" | |
nix-shell --run "rustup target add x86_64-unknown-linux-musl" | |
nix-shell --run 'rustup target add wasm32-unknown-unknown' | |
- name: Build the Leptos project to `musl` output | |
run: nix-shell --run 'cargo leptos build --release' | |
env: | |
LEPTOS_BIN_TARGET_TRIPLE: x86_64-unknown-linux-musl | |
- name: Deploy a docker container to Fly.io | |
run: nix-shell --run 'fly deploy' | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |