Skip to content

Commit 9141d1b

Browse files
add a ci step to build the docker image
1 parent a0d26bd commit 9141d1b

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/build.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
13+
steps:
14+
- name: Install Docker Buildx
15+
uses: docker/setup-buildx-action@v2
16+
- name: Checkout Repo
17+
uses: actions/checkout@v4
18+
- name: Set up Docker cache
19+
uses: actions/cache@v4
20+
with:
21+
path: /tmp/.buildx-cache
22+
key: buildx-${{ runner.os }}-${{ github.sha }}
23+
restore-keys: |
24+
buildx-${{ runner.os }}-
25+
- name: Build Docker image
26+
working-directory: ./app
27+
run: |
28+
docker buildx build \
29+
--platform linux/amd64,linux/arm64 \
30+
--cache-from type=local,src=/tmp/.buildx-cache \
31+
--cache-to type=local,dest=/tmp/.buildx-cache \
32+
.
33+
34+
test:
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
39+
steps:
40+
- name: Install poetry
41+
run: pipx install poetry
42+
- name: Set up Python
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: '3.11'
46+
47+
- name: Checkout Repo
48+
uses: actions/checkout@v4
49+
50+
- name: Set up cache for Poetry dependencies
51+
uses: actions/cache@v4
52+
with:
53+
path: ~/.cache/pypoetry
54+
key: poetry-${{ hashFiles('app/poetry.lock') }}
55+
56+
- name: Install Python dependencies with Poetry
57+
working-directory: ./app
58+
run: poetry install --no-interaction --no-root
59+
60+
- name: Run intercom test
61+
working-directory: ./app
62+
run: poetry run python test_intercom.py

0 commit comments

Comments
 (0)