Skip to content

Deploy to DigitalOcean #8

Deploy to DigitalOcean

Deploy to DigitalOcean #8

Workflow file for this run

name: Deploy to DigitalOcean
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to DigitalOcean
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.DO_USERNAME }}@${{ secrets.DO_SERVER_IP }} << 'EOF'
sudo git config --global --add safe.directory /home/rails/pet-tag-generator
cd /home/rails/pet-tag-generator
git fetch --tags
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
bundle install
rails db:migrate
sudo systemctl restart pettag
EOF