-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.44 KB
/
docker_image.yml
File metadata and controls
73 lines (64 loc) · 2.44 KB
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
68
69
70
71
72
73
name: Build docker image
on:
# run it on push when a tag is released
push:
tags:
- "*"
jobs:
# define job to build and publish docker image
build-and-push-docker-image:
name: Build Docker image and push to repositories
# run only when code is compiling and tests are passing
runs-on: ubuntu-latest
# steps to perform in job
steps:
- name: Checkout code
uses: actions/checkout@v2
# setup Docker buld action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build image and push python 3.8 version to Docker Hub
uses: docker/build-push-action@v2
with:
# relative path to the place where source code with Dockerfile is located
context: .
# Note: tags has to be all lower-case
tags: |
satel/python-base:${{env.RELEASE_VERSION}}-python3.8
build-args: |
IMAGE_VERSION=python:3.8.13-slim
push: true
- name: Build image and push python 3.9 version to Docker Hub
uses: docker/build-push-action@v2
with:
# relative path to the place where source code with Dockerfile is located
context: .
# Note: tags has to be all lower-case
tags: |
satel/python-base:${{env.RELEASE_VERSION}}-python3.9
build-args: |
IMAGE_VERSION=python:3.9.12-slim
push: true
- name: Build image and push python 3.10 version to Docker Hub
uses: docker/build-push-action@v2
with:
# relative path to the place where source code with Dockerfile is located
context: .
# Note: tags has to be all lower-case
tags: |
satel/python-base:${{env.RELEASE_VERSION}}-python3.10
build-args: |
IMAGE_VERSION=python:3.10.4-slim
push: true
- name: Build and test webapp with latest docker-python-base version
working-directory: ./tests/
run: ./build_webapp.sh
shell: bash