-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (50 loc) · 1.53 KB
/
python-app.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on: push
env:
PYTHON_VERSION: "3.12"
permissions:
contents: read
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: poetry install --with dev
- name: Lint
run: poetry run scons lint
- name: Lock
run: poetry run scons lock
- name: Type
run: poetry run scons type
- name: Test
run: poetry run scons test
- name: Sec
run: poetry run scons sec
CD:
runs-on: ubuntu-latest
needs: CI
if: github.ref == 'refs/heads/main' # expression strings must be single quoted
steps:
- name: Deploy app
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script_stop: true
script: |
source $HOME/.profile
cd ${{ secrets.SSH_WORKDIR }}
git pull origin main
poetry install
systemctl --user restart aid-collect
systemctl --user restart aid-provide