Skip to content

add private ssh, droplet ip secrets #4

add private ssh, droplet ip secrets

add private ssh, droplet ip secrets #4

Workflow file for this run

name: CI/CD Workflow
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'backend/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:

Check failure on line 15 in .github/workflows/ci-cd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-cd.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
- name: Setup SSH
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.DROPLET_IP }} >> ~/.ssh/known_hosts
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Deploy to DigitalOcean
run: |
# Use doctl to interact with your DigitalOcean droplet
# You'll want to replace `<droplet-ID>` and `<path-to-your-app>`
doctl compute ssh 357096535 -- 'cd /home/vimracing && git pull && cd backend && yarn run build && pm2 delete vimracing >2 /dev/null && pm2 start dist/index.js --name vimracing'