Add deployment workflow
All checks were successful
Deploy to Server / deploy (push) Successful in 10s
All checks were successful
Deploy to Server / deploy (push) Successful in 10s
This commit is contained in:
parent
43fa3f604a
commit
5e8b4abe2b
2 changed files with 32 additions and 21 deletions
32
.github/workflows/deploy.yaml
vendored
Normal file
32
.github/workflows/deploy.yaml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: Deploy to Server
|
||||
|
||||
# EDITOR=nvim visudo
|
||||
# forgejo-runner ALL=(ttvdrops) NOPASSWD: /usr/bin/git
|
||||
# forgejo-runner ALL=(root) NOPASSWD: /bin/systemctl restart ttvdrops
|
||||
# forgejo-runner ALL=(ttvdrops) NOPASSWD: /usr/bin/uv run python /home/ttvdrops/ttvdrops/manage.py migrate
|
||||
# forgejo-runner ALL=(ttvdrops) NOPASSWD: /usr/bin/uv sync -U
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
|
||||
env:
|
||||
DJANGO_DEBUG: False
|
||||
DJANGO_SECRET_KEY: 1234567890
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- run: uv sync --all-extras --dev
|
||||
- run: uv run pytest
|
||||
- name: Deploy to Server
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
sudo -u ttvdrops git -C /home/ttvdrops/ttvdrops pull
|
||||
sudo -u ttvdrops uv sync -U
|
||||
sudo -u ttvdrops uv run python /home/ttvdrops/ttvdrops/manage.py migrate
|
||||
sudo systemctl restart ttvdrops
|
||||
Loading…
Add table
Add a link
Reference in a new issue