File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments