2022-04-18 14:49:50 +00:00
|
|
|
name: Blessed.rs
|
|
|
|
on: [push]
|
2022-04-18 14:48:12 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-04-18 17:06:32 +00:00
|
|
|
name: Compile binary
|
2022-04-18 14:48:12 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-18 17:13:23 +00:00
|
|
|
- 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
|
2022-04-18 17:13:23 +00:00
|
|
|
- name: Compile release build
|
2022-04-18 16:59:26 +00:00
|
|
|
run: cargo build --release --all-features
|
2022-04-18 17:06:32 +00:00
|
|
|
- name: Upload binary as artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: blessed-rs-release-binary
|
|
|
|
path: target/release/blessed-rs
|
|
|
|
deploy:
|
|
|
|
name: Deploy to Heroku
|
|
|
|
runs-on: ubuntu-latest
|
2022-04-18 17:13:23 +00:00
|
|
|
needs: build
|
2022-04-18 17:06:32 +00:00
|
|
|
steps:
|
2022-04-18 17:13:23 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
2022-04-18 17:06:32 +00:00
|
|
|
- name: Download binary artifact
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: blessed-rs-release-binary
|
2022-04-18 17:37:14 +00:00
|
|
|
path: target/release
|
2022-04-18 16:59:26 +00:00
|
|
|
- name: Deploy to Heroku
|
|
|
|
uses: akhileshns/heroku-deploy@v3.12.12
|
|
|
|
with:
|
2022-04-18 17:06:32 +00:00
|
|
|
heroku_api_key: ${{secrets.HEROKU_API_TOKEN}}
|
2022-04-18 16:59:26 +00:00
|
|
|
heroku_app_name: "blessed-rs" #Must be unique in Heroku
|
|
|
|
heroku_email: "nico@nicoburns.com"
|
|
|
|
usedocker: true
|