Skip to content

Commit

Permalink
feat: CD
Browse files Browse the repository at this point in the history
  • Loading branch information
zjffun committed Sep 17, 2023
1 parent 0966057 commit a65d2af
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: docker
on:
push:
branches:
- "main"
- main

jobs:
build:
Expand All @@ -25,3 +25,20 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/dochub-server:latest

deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: SSH Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: root
password: ${{ secrets.SSH_PASSWORD }}
port: 22
script: |
sudo docker pull zjffun/dochub-server
sudo docker stop dochub-server
sudo docker remove dochub-server
sudo docker run -e DOTENV_KEY="${{ secrets.DOTENV_KEY }}" -d --restart=always --name dochub-server -p 30001:30001 zjffun/dochub-server:latest

0 comments on commit a65d2af

Please sign in to comment.