-
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (54 loc) · 1.82 KB
/
main.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
name: Test and Deploy to Heroku
on:
push:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:latest
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
ports:
- 27017:27017
options: --health-cmd "mongo --eval 'db.runCommand({ ping: 1 })'" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Configure Poetry
run: |
poetry config virtualenvs.create false
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
- name: Run tests
run: MONGO_URL=mongodb://root:password@localhost:27017 poetry run make test
- name: Build the Docker image
run: make build
env:
BUILD_SHA: ${{ github.sha }}
- name: Log in to Heroku Container Registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login
- name: Push Docker image to Heroku
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: |
docker images
docker tag prompt_sail_app:latest registry.heroku.com/promptsail/web
docker push registry.heroku.com/promptsail/web
- name: Release to Heroku
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release web -a promptsail