Merge pull request #27 from BattMoTeam/dev #1
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: Docker Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Build Docker Image | |
run: docker build -t battmogui:latest . | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Copy Docker Image to VPS | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: ${{ secrets.VPS_USERNAME }} | |
password: ${{ secrets.VPS_PASSWORD }} | |
port: 22 | |
source: "." | |
target: "/home/ubuntu/docker/battmogui" | |
- name: SSH into VPS and Load Docker Image | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: ${{ secrets.VPS_USERNAME }} | |
password: ${{ secrets.VPS_PASSWORD }} | |
port: 22 | |
script: | | |
docker load -i /home/ubuntu/docker/battmogui/battmogui.tar | |
docker run -d -p 8501:8501 -p 5000:5000 --name battmogui:latest |