blessed-rs/.github/workflows/github-actions.yml

37 lines
1.1 KiB
YAML

name: Blessed.rs
on: [push]
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
build:
name: Compile binary
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Restore rust compilation cache
uses: Swatinem/rust-cache@v2
- name: Compile release build
run: cargo build --release --all-features
- name: Upload binary as artifact
uses: actions/upload-artifact@v3
with:
name: blessed-rs-release-binary
path: target/release/blessed-rs
deploy_flyio:
name: Deploy to Fly.io
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download binary artifact
uses: actions/download-artifact@v3
with:
name: blessed-rs-release-binary
path: target/release
- name: Setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly.io
run: flyctl deploy --remote-only