diff --git a/.github/workflows/deploy.yml b/.github/workflows/client.yml similarity index 100% rename from .github/workflows/deploy.yml rename to .github/workflows/client.yml diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml new file mode 100644 index 0000000..902e279 --- /dev/null +++ b/.github/workflows/server.yml @@ -0,0 +1,23 @@ +name: Deploy to Digital Ocean + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up SSH + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Connect and deploy project + run: | + ssh -o "StrictHostKeyChecking=no" ${{ secrets.USER }}@${{ secrets.HOST }} "cd ~/bereal-wrapped && docker-compose up --build -d"