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