mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-21 01:38:55 +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 ]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build:
|
||||||
name: Build and Deploy
|
name: Build a Release Binary
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -23,6 +23,19 @@ jobs:
|
||||||
key: ${{ runner.os }}-rust-release-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-rust-release-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- name: Build release
|
- name: Build release
|
||||||
run: cargo 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
|
- name: Upload binary
|
||||||
uses: appleboy/scp-action@master
|
uses: appleboy/scp-action@master
|
||||||
with:
|
with:
|
||||||
|
@ -30,8 +43,8 @@ jobs:
|
||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.SSH_KEY }}
|
key: ${{ secrets.SSH_KEY }}
|
||||||
port: ${{ secrets.PORT }}
|
port: ${{ secrets.PORT }}
|
||||||
source: "target/release/youmubot"
|
source: youmubot-release/youmubot
|
||||||
target: "youmubot"
|
target: youmubot
|
||||||
- name: Restart youmubot
|
- name: Restart youmubot
|
||||||
uses: appleboy/ssh-action@master
|
uses: appleboy/ssh-action@master
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Add table
Reference in a new issue