-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (38 loc) · 995 Bytes
/
python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Python CI
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
env:
DATABASE_URL: sqlite://
SECRET_KEY: something_very_secret
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "latest"
- name: Install dependencies
run: uv sync --locked
- name: Collect static
run: uv run python manage.py collectstatic --no-input
- name: Run Tests
run: uv run pytest
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
bash projects/surfcams/.deploy/update.sh