-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (77 loc) · 2.34 KB
/
config.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Continuous Integration and Delivery
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test_app:
name: Testing the app
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
DEBUG: ${{ secrets.DEBUG }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: flake8
- name: Run app tests
run: |
coverage run --source='.' --omit='oc_lettings_site/settings*','*/migrations/*' manage.py test --settings oc_lettings_site.settings-ci
coverage report --fail-under=80
# create a job for updating the documentation
docker:
name: Docker
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
DEBUG: ${{ secrets.DEBUG }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
COMMIT_HASH: ${{ github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build the Docker image
run: |
docker build -t oc_lettings .
docker images
- name: Tag the Docker image
run: docker tag oc_lettings:latest doridoro/oc_lettings_site:${COMMIT_HASH::7}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image to Docker Hub
run: docker push doridoro/oc_lettings_site:${COMMIT_HASH::7}
# docker_actions:
# name: Docker
# runs-on: ubuntu-latest
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# push: true
# tags: doridoro/oc_lettings_site:latest