Skip to content

Commit

Permalink
feat: add mercure into deploy api ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Leoglme committed Jan 22, 2024
1 parent af21743 commit a29528f
Showing 1 changed file with 6 additions and 32 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,12 @@ jobs:
npm run build
cp .env build/.env
- name: 🐳 Copy docker-compose.yml to build folder
run: cp docker-compose.yml build/docker-compose.yml

- name: 🛁 Clean install for production
run: cd build && npm ci --production --ignore-scripts

- name: 📤 Deploy to VPS
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: "./build/"
target: ${{ env.APP_DIR }}/html

- name: 📤 Deploy to VPS
uses: easingthemes/ssh-deploy@main
with:
Expand Down Expand Up @@ -87,27 +80,8 @@ jobs:
node ace migration:run --force
echo "Running Seeders..."
node ace db:seed
echo "Deployment completed successfully!"
- name: 📤 Copy Docker Compose file for Mercure SSE to VPS
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: "./path_to_your_mercure_docker_compose/docker-compose-mercure.yml"
target: ${{ env.APP_DIR }}

- name: 🚀 Start Mercure SSE service
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USERNAME }}
REMOTE_PORT: ${{ secrets.SSH_PORT }}
TARGET: ${{ env.APP_DIR }}
SCRIPT: |
echo "Deploying Mercure SSE service..."
cd ${{ env.APP_DIR }}
docker-compose -f docker-compose-mercure.yml up -d
docker-compose up -d mercure-sse
echo "Mercure SSE service deployed successfully!"
echo "Deployment completed successfully!"

0 comments on commit a29528f

Please sign in to comment.