Skip to content

Commit 6eebbc9

Browse files
committed
feat: add /action.yml to repo
Forge ID: F#T67483
1 parent 0670fe9 commit 6eebbc9

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

action.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy to remote server
2+
description: Deploy to remote server
3+
4+
runs:
5+
using: "composite"
6+
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
11+
- name: Set up SSH agent
12+
uses: webfactory/ssh-agent@v0.9.0
13+
with:
14+
ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
15+
16+
- name: Add remote host to known_hosts
17+
run: |
18+
ssh-keyscan -p ${{ secrets.DEPLOY_SSH_PORT }} ${{ secrets.DEPLOY_SSH_HOST }} >> ~/.ssh/known_hosts
19+
20+
- name: Generate deploy.yml
21+
run: |
22+
cat > deploy.yml <<EOF
23+
${{ secrets.DEPLOY_INSTANCE }}:
24+
ssh_host: ${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }}
25+
ssh_port: ${{ secrets.DEPLOY_SSH_PORT }}
26+
repo_url: git@github.com:${{ github.repository }}.git
27+
EOF
28+
29+
- name: Append db to deploy.yml if exist
30+
env:
31+
deploy_db: ${{ secrets.DEPLOY_DB }}
32+
if: ${{ env.deploy_db != '' }}
33+
run: |
34+
echo " db: ${{ env.deploy_db }}" >> deploy.yml
35+
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v5
38+
39+
- name: Install deploy
40+
run: uv tool install "git+https://github.com/trobz/deploy.py.git"
41+
42+
- name: Deploy
43+
run: |
44+
deploy --config deploy.yml --verbose update ${{ secrets.DEPLOY_INSTANCE }}
45+
46+
branding:
47+
icon: "box"
48+
color: "orange"

0 commit comments

Comments
 (0)