Skip to content

Commit a3773f9

Browse files
authored
Merge pull request #210 from zjgemi/master
Add a GitHub action for building docker image and pushing to Docker Hub
2 parents 2e260eb + 7c51316 commit a3773f9

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/ci-docker.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build docker image and push to Docker Hub
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-n-push:
10+
name: Build docker image and push to Docker Hub
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repo
14+
uses: actions/checkout@v3
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v2
24+
25+
- name: Set up Docker Buildx
26+
id: buildx
27+
uses: docker/setup-buildx-action@v2
28+
29+
- name: Build and push
30+
run: |
31+
docker buildx build --platform linux/arm64,linux/amd64 -t dptechnology/dpdispatcher:latest --push .

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.8
2+
3+
WORKDIR /data/dpdispatcher
4+
ADD requirements.txt ./
5+
RUN pip install -r requirements.txt
6+
COPY ./ ./
7+
RUN pip install .

0 commit comments

Comments
 (0)