Skip to content

Commit b1f5934

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

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

action.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy to Production
2+
description: Deploy to production 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 production 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+
db: ${{ secrets.DEPLOY_PRODUCTION_DB }}
28+
EOF
29+
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
32+
33+
- name: Install deploy
34+
run: uv tool install "git+https://github.com/trobz/deploy.py.git"
35+
36+
- name: Deploy
37+
run: |
38+
deploy --config deploy.yml --verbose update ${{ secrets.DEPLOY_INSTANCE }}
39+
40+
branding:
41+
icon: "box"
42+
color: "orange"

0 commit comments

Comments
 (0)