Skip to content

Commit

Permalink
first try for CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
altf4arnold committed Mar 1, 2024
1 parent e8b3afc commit 2910db9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy

on:
push:
branches:
- master

concurrency:
group: master
cancel-in-progress: true

jobs:
flake:
name: flake
uses: ./.github/workflows/flake.yml
django:
name: django
uses: ./.github/workflows/django.yml
deploy:
name: Deploy
needs: [ flake, django ]
runs-on: ubuntu-latest
steps:
- name: Configure SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
kdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/github
chmod 600 ~/.ssh/github
cat >>~/.ssh/config <<END
Host target
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/github
LogLevel ERROR
StrictHostKeyChecking no
END
- name: Run Deploy
run: |
ssh target "cd /opt/tldtest/ && git pull && pip install -r requirements.txt && ./manage.py makemigrations && ./manage.py migrate && systemctl restart tldtest"

0 comments on commit 2910db9

Please sign in to comment.