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

41 lines
1.2 KiB
YAML
Raw Normal View History

2022-04-18 14:49:50 +00:00
name: Blessed.rs
on: [push]
2022-05-01 21:07:22 +00:00
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
2022-04-18 14:48:12 +00:00
jobs:
build:
name: Compile binary
2022-04-18 14:48:12 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
2022-04-18 14:48:12 +00:00
with:
toolchain: stable
2022-04-18 21:47:56 +00:00
- name: Restore rust compilation cache
uses: Swatinem/rust-cache@v1
- name: Compile release build
2022-04-18 16:59:26 +00:00
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
2022-05-01 21:07:22 +00:00
deploy_flyio:
2022-05-01 21:58:03 +00:00
name: Deploy to Fly.io
2022-05-01 21:07:22 +00:00
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v2
- 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
2022-05-01 21:58:03 +00:00
run: flyctl deploy --remote-only