FIX: Fix some bugs closes #35 closes #36 #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build-and-push | |
steps: | |
- 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 down && sudo docker-compose pull && sudo docker-compose up -d |