From 0164215c7bce75f32ff8f30d8d910e81d00d8201 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sat, 27 Jun 2020 22:22:24 -0400 Subject: [PATCH] Split deploy to build and deploy jobs with artifacts --- .github/workflows/deploy.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ca4350..533e782 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: