Skip to content

Commit 58247b9

Browse files
dkorunicoktalz
authored andcommitted
BUILD/MINOR: ci: Enable GHCR packages for auto, manual and nightly builds
1 parent 6536a0b commit 58247b9

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

.github/workflows/docker_auto_release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,29 @@ on:
66
jobs:
77
main:
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
packages: write
912
env:
1013
DOCKER_PLATFORMS: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386
1114
DOCKER_IMAGE: haproxytech/kubernetes-ingress
1215
LATEST_BRANCH: "1.9"
1316
steps:
1417
- name: Login to Docker Hub
15-
id: login
18+
id: login_docker
1619
uses: docker/login-action@v1
1720
with:
1821
username: ${{ secrets.DOCKER_HUB_USERNAME }}
1922
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
2023

24+
- name: Login to Container Registry
25+
id: login_ghcr
26+
uses: docker/login-action@v1
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
2132
- name: Set up QEMU
2233
uses: docker/setup-qemu-action@v1
2334

@@ -71,6 +82,9 @@ jobs:
7182
${{ env.DOCKER_IMAGE }}:latest
7283
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_BRANCH }}
7384
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_VER }}
85+
ghcr.io/${{ github.repository }}:latest
86+
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
87+
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
7488
cache-from: type=local,src=/tmp/.buildx-cache
7589
cache-to: type=local,dest=/tmp/.buildx-cache-new
7690

@@ -95,6 +109,8 @@ jobs:
95109
tags: |
96110
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_BRANCH }}
97111
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_VER }}
112+
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
113+
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
98114
cache-from: type=local,src=/tmp/.buildx-cache
99115
cache-to: type=local,dest=/tmp/.buildx-cache-new
100116

.github/workflows/docker_manual_release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,29 @@ on:
44
jobs:
55
main:
66
runs-on: ubuntu-latest
7+
permissions:
8+
contents: read
9+
packages: write
710
env:
811
DOCKER_PLATFORMS: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386
912
DOCKER_IMAGE: haproxytech/kubernetes-ingress
1013
LATEST_BRANCH: "1.9"
1114
steps:
1215
- name: Login to Docker Hub
13-
id: login
16+
id: login_docker
1417
uses: docker/login-action@v1
1518
with:
1619
username: ${{ secrets.DOCKER_HUB_USERNAME }}
1720
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
1821

22+
- name: Login to Container Registry
23+
id: login_ghcr
24+
uses: docker/login-action@v1
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
1930
- name: Set up QEMU
2031
uses: docker/setup-qemu-action@v1
2132

@@ -73,6 +84,9 @@ jobs:
7384
${{ env.DOCKER_IMAGE }}:latest
7485
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_BRANCH }}
7586
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_VER }}
87+
ghcr.io/${{ github.repository }}:latest
88+
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
89+
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
7690
cache-from: type=local,src=/tmp/.buildx-cache
7791
cache-to: type=local,dest=/tmp/.buildx-cache-new
7892

@@ -97,6 +111,8 @@ jobs:
97111
tags: |
98112
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_BRANCH }}
99113
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_VER }}
114+
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
115+
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
100116
cache-from: type=local,src=/tmp/.buildx-cache
101117
cache-to: type=local,dest=/tmp/.buildx-cache-new
102118

.github/workflows/docker_nightly.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,28 @@ jobs:
99
main:
1010
if: ${{ github.repository_owner == 'haproxytech' }}
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
1215
env:
1316
DOCKER_PLATFORMS: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386
1417
DOCKER_IMAGE: haproxytech/kubernetes-ingress
1518
steps:
1619
- name: Login to Docker Hub
17-
id: login
20+
id: login_docker
1821
uses: docker/login-action@v1
1922
with:
2023
username: ${{ secrets.DOCKER_HUB_USERNAME }}
2124
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
2225

26+
- name: Login to Container Registry
27+
id: login_ghcr
28+
uses: docker/login-action@v1
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
2334
- name: Set up QEMU
2435
uses: docker/setup-qemu-action@v1
2536

@@ -67,6 +78,7 @@ jobs:
6778
org.opencontainers.image.version=nightly
6879
tags: |
6980
${{ env.DOCKER_IMAGE }}:nightly
81+
ghcr.io/${{ github.repository }}:nightly
7082
cache-from: type=local,src=/tmp/.buildx-cache
7183
cache-to: type=local,dest=/tmp/.buildx-cache-new
7284

0 commit comments

Comments
 (0)