-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 1.66 KB
/
ci-cd.yaml
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
name: moviesAPI CI/CD
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
env:
MOVIES_DB_URL: ${{ secrets.MOVIES_DB_URL }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
AWSSecretKey: ${{ secrets.AWSSecretKey }}
AWSAccessKeyId: ${{ secrets.AWSAccessKeyId }}
steps:
- name: Start
uses: actions/checkout@v3
- name: Install python
uses: actions/setup-python@v3
with:
python-version: '3.10.6'
- name: Upgrade pip version to latest
run: python -m pip install --upgrade pip
- name: Install app dependencies
run: pip install -r requirements.txt
test:
name: Test Books API
runs-on: ubuntu-latest
env:
MOVIES_DB_URL: ${{ secrets.MOVIES_DB_URL }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
AWSSecretKey: ${{ secrets.AWSSecretKey }}
AWSAccessKeyId: ${{ secrets.AWSAccessKeyId }}
needs:
- build
steps:
- name: start test
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.10.6'
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install pytest
run: pip install pytest
- name: Run test
run: pytest
deploy:
name: Deploy
runs-on: ubuntu-latest
# needs:
# - test
steps:
- name: Deploy to Render
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.RENDER_SERVICE_ID }}
api-key: ${{ secrets.RENDER_API_KEY }}