Skip to content

Commit aa45761

Browse files
cfsmp3claude
andauthored
feat: auto-deploy to production after images are built (#442)
Add a deploy job that automatically deploys to production after both frontend and backend images are built and pushed to GHCR. The deploy job: - Waits for both build jobs to complete - Uses the production environment (for SSH credentials) - Runs deploy.sh with the commit SHA as the image tag - Provides a deployment summary in the workflow This makes deployment fully automatic: push to main → build → deploy. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent acf2062 commit aa45761

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,28 @@ jobs:
6969
ghcr.io/ccextractor/backend:${{ github.sha }}
7070
cache-from: type=gha
7171
cache-to: type=gha,mode=max
72+
73+
deploy:
74+
needs: [build-and-push-frontend, build-and-push-backend]
75+
runs-on: ubuntu-latest
76+
environment: production
77+
78+
steps:
79+
- name: Deploy to VPS
80+
uses: appleboy/ssh-action@v1.2.0
81+
with:
82+
host: ${{ vars.SSH_HOST }}
83+
username: ${{ vars.SSH_USER }}
84+
key: ${{ secrets.DEPLOY_SSH_KEY }}
85+
port: ${{ vars.SSH_PORT }}
86+
command_timeout: 10m
87+
script: |
88+
/opt/ccsync/scripts/deploy.sh ${{ github.sha }}
89+
90+
- name: Deployment summary
91+
run: |
92+
echo "## Deployment Complete" >> $GITHUB_STEP_SUMMARY
93+
echo "" >> $GITHUB_STEP_SUMMARY
94+
echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
95+
echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
96+
echo "- **Server:** https://taskwarrior-server.ccextractor.org" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)