Skip to content

Update README.md

Update README.md #23

Workflow file for this run

name: Deploy to Production
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t vineetagarwal2004/v3cn:${{ github.sha }} -t vineetagarwal2004/v3cn:latest .
docker push --all-tags vineetagarwal2004/v3cn
- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /home/ubuntu/compose-files/v3cn
docker-compose pull
docker-compose up -d --force-recreate --no-deps
docker image prune -f