Skip to content

Commit deb7f27

Browse files
Add GHCR login step using docker/login-action@v3 in CI workflows complete examples
1 parent db83814 commit deb7f27

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed

pipelines/02-complete.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ jobs:
7676
with:
7777
name: code
7878
path: .
79+
- name: Log in to GHCR
80+
uses: docker/login-action@v3
81+
with:
82+
registry: ghcr.io
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
7985
- name: build docker
8086
run: bash ci/build-docker.sh
8187
- name: push docker
@@ -98,6 +104,12 @@ jobs:
98104
with:
99105
name: code
100106
path: .
107+
- name: Log in to GHCR
108+
uses: docker/login-action@v3
109+
with:
110+
registry: ghcr.io
111+
username: ${{ github.actor }}
112+
password: ${{ secrets.GITHUB_TOKEN }}
101113
- name: Run Trivy vulnerability scanner
102114
uses: aquasecurity/trivy-action@master
103115
with:
@@ -116,6 +128,12 @@ jobs:
116128
with:
117129
name: code
118130
path: .
131+
- name: Log in to GHCR
132+
uses: docker/login-action@v3
133+
with:
134+
registry: ghcr.io
135+
username: ${{ github.actor }}
136+
password: ${{ secrets.GITHUB_TOKEN }}
119137
- name: Execute component test
120138
run: bash ci/component-test.sh
121139
Performance-test:
@@ -127,6 +145,12 @@ jobs:
127145
with:
128146
name: code
129147
path: .
148+
- name: Log in to GHCR
149+
uses: docker/login-action@v3
150+
with:
151+
registry: ghcr.io
152+
username: ${{ github.actor }}
153+
password: ${{ secrets.GITHUB_TOKEN }}
130154
- name: Execute performance test
131155
run: bash ci/performance-test.sh
132156
Deploy:
@@ -138,6 +162,12 @@ jobs:
138162
with:
139163
name: code
140164
path: .
165+
- name: Log in to GHCR
166+
uses: docker/login-action@v3
167+
with:
168+
registry: ghcr.io
169+
username: ${{ github.actor }}
170+
password: ${{ secrets.GITHUB_TOKEN }}
141171
- name: Deploy to production
142172
run: bash ci/start-application.sh
143173
- name: stop production environment

pipelines/03-complete.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ jobs:
9393
with:
9494
name: code
9595
path: .
96+
- name: Log in to GHCR
97+
uses: docker/login-action@v3
98+
with:
99+
registry: ghcr.io
100+
username: ${{ github.actor }}
101+
password: ${{ secrets.GITHUB_TOKEN }}
96102
- name: build docker
97103
run: bash ci/build-docker.sh
98104
- name: push docker
@@ -144,6 +150,12 @@ jobs:
144150
with:
145151
name: code
146152
path: .
153+
- name: Log in to GHCR
154+
uses: docker/login-action@v3
155+
with:
156+
registry: ghcr.io
157+
username: ${{ github.actor }}
158+
password: ${{ secrets.GITHUB_TOKEN }}
147159
- name: Run Trivy vulnerability scanner
148160
uses: aquasecurity/trivy-action@master
149161
with:
@@ -162,6 +174,12 @@ jobs:
162174
with:
163175
name: code
164176
path: .
177+
- name: Log in to GHCR
178+
uses: docker/login-action@v3
179+
with:
180+
registry: ghcr.io
181+
username: ${{ github.actor }}
182+
password: ${{ secrets.GITHUB_TOKEN }}
165183
- name: Execute component test
166184
run: bash ci/component-test.sh
167185
Performance-test:
@@ -173,6 +191,12 @@ jobs:
173191
with:
174192
name: code
175193
path: .
194+
- name: Log in to GHCR
195+
uses: docker/login-action@v3
196+
with:
197+
registry: ghcr.io
198+
username: ${{ github.actor }}
199+
password: ${{ secrets.GITHUB_TOKEN }}
176200
- name: Execute performance test
177201
run: bash ci/performance-test.sh
178202
Deploy:
@@ -184,6 +208,12 @@ jobs:
184208
with:
185209
name: code
186210
path: .
211+
- name: Log in to GHCR
212+
uses: docker/login-action@v3
213+
with:
214+
registry: ghcr.io
215+
username: ${{ github.actor }}
216+
password: ${{ secrets.GITHUB_TOKEN }}
187217
- name: Deploy to production
188218
run: bash ci/start-application.sh
189219
- name: stop production environment

pipelines/04-complete.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ jobs:
9292
with:
9393
name: code
9494
path: .
95+
- name: Log in to GHCR
96+
uses: docker/login-action@v3
97+
with:
98+
registry: ghcr.io
99+
username: ${{ github.actor }}
100+
password: ${{ secrets.GITHUB_TOKEN }}
95101
- name: build docker
96102
run: bash ci/build-docker.sh
97103
- name: push docker
@@ -143,6 +149,12 @@ jobs:
143149
with:
144150
name: code
145151
path: .
152+
- name: Log in to GHCR
153+
uses: docker/login-action@v3
154+
with:
155+
registry: ghcr.io
156+
username: ${{ github.actor }}
157+
password: ${{ secrets.GITHUB_TOKEN }}
146158
- name: Run Trivy vulnerability scanner
147159
uses: aquasecurity/trivy-action@master
148160
with:
@@ -161,6 +173,12 @@ jobs:
161173
with:
162174
name: code
163175
path: .
176+
- name: Log in to GHCR
177+
uses: docker/login-action@v3
178+
with:
179+
registry: ghcr.io
180+
username: ${{ github.actor }}
181+
password: ${{ secrets.GITHUB_TOKEN }}
164182
- name: Execute component test
165183
run: bash ci/component-test.sh
166184
Performance-test:
@@ -172,6 +190,12 @@ jobs:
172190
with:
173191
name: code
174192
path: .
193+
- name: Log in to GHCR
194+
uses: docker/login-action@v3
195+
with:
196+
registry: ghcr.io
197+
username: ${{ github.actor }}
198+
password: ${{ secrets.GITHUB_TOKEN }}
175199
- name: Execute performance test
176200
run: bash ci/performance-test.sh
177201
Deploy:
@@ -183,6 +207,12 @@ jobs:
183207
with:
184208
name: code
185209
path: .
210+
- name: Log in to GHCR
211+
uses: docker/login-action@v3
212+
with:
213+
registry: ghcr.io
214+
username: ${{ github.actor }}
215+
password: ${{ secrets.GITHUB_TOKEN }}
186216
- name: Setup Kosli CLI
187217
uses: kosli-dev/setup-cli-action@v2
188218
with:

pipelines/05-complete.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ jobs:
9393
with:
9494
name: code
9595
path: .
96+
- name: Log in to GHCR
97+
uses: docker/login-action@v3
98+
with:
99+
registry: ghcr.io
100+
username: ${{ github.actor }}
101+
password: ${{ secrets.GITHUB_TOKEN }}
96102
- name: build docker
97103
run: bash ci/build-docker.sh
98104
- name: push docker
@@ -144,6 +150,12 @@ jobs:
144150
with:
145151
name: code
146152
path: .
153+
- name: Log in to GHCR
154+
uses: docker/login-action@v3
155+
with:
156+
registry: ghcr.io
157+
username: ${{ github.actor }}
158+
password: ${{ secrets.GITHUB_TOKEN }}
147159
- name: Run Trivy vulnerability scanner
148160
uses: aquasecurity/trivy-action@master
149161
with:
@@ -162,6 +174,12 @@ jobs:
162174
with:
163175
name: code
164176
path: .
177+
- name: Log in to GHCR
178+
uses: docker/login-action@v3
179+
with:
180+
registry: ghcr.io
181+
username: ${{ github.actor }}
182+
password: ${{ secrets.GITHUB_TOKEN }}
165183
- name: Execute component test
166184
run: bash ci/component-test.sh
167185
Performance-test:
@@ -173,6 +191,12 @@ jobs:
173191
with:
174192
name: code
175193
path: .
194+
- name: Log in to GHCR
195+
uses: docker/login-action@v3
196+
with:
197+
registry: ghcr.io
198+
username: ${{ github.actor }}
199+
password: ${{ secrets.GITHUB_TOKEN }}
176200
- name: Execute performance test
177201
run: bash ci/performance-test.sh
178202
Deploy:
@@ -184,6 +208,12 @@ jobs:
184208
with:
185209
name: code
186210
path: .
211+
- name: Log in to GHCR
212+
uses: docker/login-action@v3
213+
with:
214+
registry: ghcr.io
215+
username: ${{ github.actor }}
216+
password: ${{ secrets.GITHUB_TOKEN }}
187217
- name: Setup Kosli CLI
188218
uses: kosli-dev/setup-cli-action@v2
189219
with:

0 commit comments

Comments
 (0)