Skip to content

Commit 5f8b028

Browse files
authored
Merge pull request #10 from AusSRC/container
Automated Docker image build CI
2 parents 2bd93b5 + 841a558 commit 5f8b028

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Docker build latest
2+
3+
on: [push]
4+
5+
jobs:
6+
docker-build-and-push:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Build the Docker image
10+
uses: actions/checkout@v2
11+
with:
12+
username: ${{ secrets.DOCKERHUB_USERNAME }}
13+
password: ${{ secrets.DOCKERHUB_TOKEN }}
14+
- run: |
15+
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin docker.io
16+
docker build . --file Dockerfile --tag docker.io/${{ secrets.DOCKERHUB_USERNAME }}/sofiax:latest
17+
docker push docker.io/${{ secrets.DOCKERHUB_USERNAME }}/sofiax:latest
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docker build release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
docker-build-and-push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
-
14+
name: Set release version
15+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
16+
-
17+
name: Build the Docker image
18+
uses: actions/checkout@v2
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
-
23+
run: |
24+
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin docker.io
25+
docker build . --file Dockerfile --tag docker.io/${{ secrets.DOCKERHUB_USERNAME }}/sofiax:$RELEASE_VERSION
26+
docker push docker.io/${{ secrets.DOCKERHUB_USERNAME }}/sofiax:$RELEASE_VERSION

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.8
2+
WORKDIR /app
3+
4+
RUN git clone https://github.com/AusSRC/SoFiAX.git &&\
5+
cd SoFiAX &&\
6+
python3 setup.py install
7+
8+
ENTRYPOINT [ "sofiax" ]

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
An [AusSRC](https://aussrc.org/) Project.
33

44
[![Functional tests](https://github.com/AusSRC/SoFiAX/actions/workflows/tests.yml/badge.svg)](https://github.com/AusSRC/SoFiAX/actions/workflows/tests.yml)
5+
[![Docker latest](https://github.com/AusSRC/SoFiAX/actions/workflows/docker-build-latest.yml/badge.svg)](https://github.com/AusSRC/SoFiAX/actions/workflows/docker-build-latest.yml)
56

67
## Description
78

0 commit comments

Comments
 (0)