No more deploy!

This commit is contained in:
Natsu Kagami 2021-11-03 14:37:19 -04:00
parent 03b83f84e9
commit b254f5085a
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51

View file

@ -1,62 +0,0 @@
name: Deploy
on:
push:
branches: [ master ]
jobs:
build:
name: Build a Release Binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
id: cargo
with:
toolchain: stable
components: clippy
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-release-build
- name: Build release
run: cargo build --release
env:
SQLX_OFFLINE: "true"
- name: Upload compiled binary artifact
uses: actions/upload-artifact@v1
with:
name: youmubot-release
path: target/release/youmubot
deploy:
name: Deploy to remote
needs: build
runs-on: ubuntu-latest
steps:
- name: Collect artifact
uses: actions/download-artifact@v1
with:
name: youmubot-release
- name: Upload binary
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
source: youmubot-release/youmubot
target: youmubot
strip_components: 1
- name: Restart youmubot
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
script: |
chmod +x youmubot/youmubot
systemctl --user restart youmubot