-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (43 loc) · 1.57 KB
/
provide-docker-images.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
name: Provide needed docker images in ghcr.io
on:
workflow_dispatch:
push:
env:
REGISTRY_IMAGE: ghcr.io/novatecconsulting/opentelemetry-training
jobs:
retag_and_push:
name: Provide docker image ${{ matrix.image.namespace }}/${{ matrix.image.name }}:${{ matrix.image.tag }} on ghcr.io
runs-on: [ubuntu-latest]
strategy:
matrix:
image:
- name: todobackend-springboot
tag: v2404
namespace: maeddes
- name: todoui-thymeleaf
tag: v2404
namespace: maeddes
- name: todoui-flask
tag: v2404
namespace: maeddes
- name: simple-generator
tag: v2404
namespace: maeddes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull image from Docker Hub
run: |
docker pull docker.io/${{ matrix.image.namespace }}/${{ matrix.image.name }}:${{ matrix.image.tag }}
- name: Retag the image for GitHub Container Registry
run: |
docker tag ${{ matrix.image.namespace }}/${{ matrix.image.name }}:${{ matrix.image.tag }} ${{ env.REGISTRY_IMAGE }}-${{ matrix.image.name }}:${{ matrix.image.tag }}
- name: Push image to GitHub Container Registry
run: |
docker push ${{ env.REGISTRY_IMAGE }}-${{ matrix.image.name }}:${{ matrix.image.tag }}