diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e87074..1c2f619 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,3 +39,12 @@ jobs: - name: Push Docker image run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/base64-tool:latest + + - name: Deploy to server + run: | + ssh -o StrictHostKeyChecking=no ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} << 'EOF' + docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/base64-tool:latest + docker stop base64-tool || true + docker rm base64-tool || true + docker run -d -p 3000:3000 --name base64-tool ${{ secrets.DOCKER_HUB_USERNAME }}/base64-tool:latest + EOF