mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-20 17:28:54 +00:00
Split deploy to build and deploy jobs with artifacts
This commit is contained in:
parent
550701c73b
commit
0164215c7b
1 changed files with 17 additions and 4 deletions
21
.github/workflows/deploy.yml
vendored
21
.github/workflows/deploy.yml
vendored
|
@ -6,8 +6,8 @@ name: Deploy
|
|||
on: [ push ]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Build and Deploy
|
||||
build:
|
||||
name: Build a Release Binary
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -23,6 +23,19 @@ jobs:
|
|||
key: ${{ runner.os }}-rust-release-${{ hashFiles('**/Cargo.lock') }}
|
||||
- name: Build release
|
||||
run: cargo build --release
|
||||
- name: Upload compiled binary artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: youmubot-release
|
||||
path: target/release/youmubot
|
||||
deploy:
|
||||
name: Deploy to remote
|
||||
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:
|
||||
|
@ -30,8 +43,8 @@ jobs:
|
|||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
source: "target/release/youmubot"
|
||||
target: "youmubot"
|
||||
source: youmubot-release/youmubot
|
||||
target: youmubot
|
||||
- name: Restart youmubot
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
|
|
Loading…
Add table
Reference in a new issue