-
-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (49 loc) · 2.33 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ master ]
env:
DOCKER_REGISTRY: ${{secrets.DOCKER_REGISTRY}}
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_ACCESS_TOKEN: ${{secrets.DOCKER_ACCESS_TOKEN}}
GITHUB_CONTAINER_REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker Image
run: make build
- name: Login to DockerHub
run: echo -n $DOCKER_ACCESS_TOKEN | docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin
- name: Push Image to DockerHub
run: docker push thehale/python-poetry:latest
- name: Tag the image for the GitHub Container Registry
run: docker tag thehale/python-poetry:latest ghcr.io/thehale/python-poetry:latest
- name: Login to GitHub Container Registry
run: echo -n ${{ secrets.GITHUB_TOKEN }} | docker login $GITHUB_CONTAINER_REGISTRY -u ${{ github.actor }} --password-stdin
- name: Push Image to GitHub Container Registry
run: docker push ghcr.io/thehale/python-poetry:latest
build-versions:
runs-on: ubuntu-latest
strategy:
matrix:
python_image_tag: ["3.8-slim", "3.9-slim", "3.10-slim", "3.11-slim"]
poetry_version: ["1.5.1", "1.6.1"]
steps:
- uses: actions/checkout@v3
- name: Build the Docker Image
run: >
make build-version \
POETRY_VERSION=${{ matrix.poetry_version }} \
PYTHON_IMAGE_TAG=${{ matrix.python_image_tag }}
- name: Login to DockerHub
run: echo -n $DOCKER_ACCESS_TOKEN | docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin
- name: Push Image to DockerHub
run: docker push thehale/python-poetry:${{ matrix.poetry_version }}-py${{ matrix.python_image_tag }}
- name: Login to GitHub Container Registry
run: echo -n ${{ secrets.GITHUB_TOKEN }} | docker login $GITHUB_CONTAINER_REGISTRY -u ${{ github.actor }} --password-stdin
- name: Tag the image for the GitHub Container Registry
run: docker tag thehale/python-poetry:${{ matrix.poetry_version }}-py${{ matrix.python_image_tag }} ghcr.io/thehale/python-poetry:${{ matrix.poetry_version }}-py${{ matrix.python_image_tag }}
- name: Push Image to GitHub Container Registry
run: docker push ghcr.io/thehale/python-poetry:${{ matrix.poetry_version }}-py${{ matrix.python_image_tag }}