You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/ci.yml
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -192,6 +192,7 @@ jobs:
192
192
build-and-publish-docker-image: # job to build the docker image and publish it to the GitHub Container Registry
193
193
runs-on: ubuntu-latest # using the latest ubuntu runner
194
194
needs: [build, uat-parallel-tests] # this job needs build and uat-parallel-tests jobs as a requirement to run
195
+
if: github.ref == 'refs/heads/main' # run this job only when the branch is main branch and not on pull requests or other branches - https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
195
196
# permissions for write acces to the packages and id-token and push access to the repository to create the container registry token
196
197
permissions:
197
198
packages: write
@@ -228,9 +229,12 @@ jobs:
228
229
registry: ${{ env.REGISTRY }} # using the registry environment variable
229
230
username: ${{ github.actor }} # using the github.actor context
230
231
password: ${{ secrets.GITHUB_TOKEN }} # using the GITHUB_TOKEN secret
231
-
- name: Docker push # push the docker image to the GitHub Container Registry
context: . # using the current directory as the context
236
+
push: true # push the docker image to the registry
237
+
tags: ghcr.io/octodemo/${{ github.repository }}:${{ github.run_number }} # tag the docker image with the current run number from the github action workflow run
234
238
235
239
runner-indexes: # job to generate the runner indexes for the uat-parallel-tests job
0 commit comments