Skip to content

Update cicd.yml

Update cicd.yml #9

Workflow file for this run

name: Docker Compose CI/CD Microservices
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
# Deploy to Ubuntu VPS
- name: Deploy to Ubuntu VPS
run: |
sudo apt-get update
sudo apt-get install -y sshpass
sshpass -p"${{ secrets.DEPLOY_PASSWORD }}" ssh -o StrictHostKeyChecking=no ubuntu@140.238.204.230 'cd bune-microservices && docker-compose pull && docker-compose up -d'
env:
DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}