-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.61 KB
/
Copy pathdeploy.yml
File metadata and controls
47 lines (42 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy Binary
# Triggered after the Release workflow completes successfully.
# Downloads the Linux x86_64 binary from the Release artifacts and deploys it to production.
on:
workflow_run:
workflows: [Release]
types: [completed]
jobs:
deploy-binary:
name: Deploy to Production
runs-on: ubuntu-latest
# Only deploy when the Release workflow succeeded
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download Linux binary from release
uses: actions/download-artifact@v8
with:
name: artifacts-x86_64-unknown-linux-gnu
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract binary from cargo-dist archive
run: |
tar -xzf dk-x86_64-unknown-linux-gnu.tar.gz
chmod +x dk
- name: Upload binary to server
uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
source: "dk"
target: "/tmp/"
- name: Install binary on server
uses: appleboy/ssh-action@0ff4204d59e8e51228ff73bce53f80d53301dee2 # v1.2.5
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
chmod +x /tmp/dk
mv /tmp/dk /home/dakera/.local/bin/dk
echo "✅ dk deployed from release ${{ github.event.workflow_run.head_branch }}"