feat(pipeline): Add deploy job
This commit is contained in:
36
.gitea/workflows/deploy.yaml
Normal file
36
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Deploy to Production
|
||||||
|
run-name: ${{ gitea.actor }} triggered deployment on ${{ gitea.ref_name }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Frontend CI/CD", "Backend CI/CD"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ gitea.event.workflow_run.conclusion == 'success' }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
echo "${{ secrets.SYNOLOGY_DEPLOY_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
- name: Deploy to server
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=accept-new deploy@ds218 'sudo /usr/local/bin/deployLegalconsenthub.sh'
|
||||||
|
|
||||||
|
- name: Deployment successful
|
||||||
|
run: |
|
||||||
|
echo "✅ Deployment triggered successfully"
|
||||||
|
echo "🚀 Application is being deployed to production"
|
||||||
|
|
||||||
Reference in New Issue
Block a user