Skip to content

FEAT: Add compose file #20

FEAT: Add compose file

FEAT: Add compose file #20

Workflow file for this run

name: Build and Deploy to Docker Hub
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4 # Clone the Repository
- 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
uses: docker/build-push-action@v6
with:
context: .
file: ./web/Dockerfile
push: true
tags: thinley44/dchat-web:latest
- name: Verify Pushed Image
run: docker pull thinley44/dchat-web:latest
- name: Deploy to Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /root/composeFile
sudo docker-compose up -d