diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b5e4f46 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,20 @@ +name: Deploy to DigitalOcean + +on: + workflow_dispatch: + push: + branches: + - main +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up SSH + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.DO_SSH_KEY }} + - name: Deploy to DigitalOcean + run: | + ssh -o StrictHostKeyChecking=no ${{secrets.DO_USERNAME}}@${{secrets.DO_IP_ADDR}} 'cd fun-banking-api && ./deploy.sh' \ No newline at end of file