Skip to content

Commit

Permalink
ci: update registry env (#643)
Browse files Browse the repository at this point in the history
Signed-off-by: Heba <[email protected]>
  • Loading branch information
helayoty authored Aug 13, 2024
1 parent 1051c96 commit 2e9b02e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,21 @@ permissions:
actions: read

env:
REGISTRY: ghcr.io
# Common versions
GO_VERSION: '1.20'
IMAGE_NAME: 'virtual-kubelet'

jobs:
publish-images:
env:
REGISTRY: ${{ github.event.client_payload.registry }}
runs-on: ubuntu-latest
steps:
- name: Login to ${{ env.REGISTRY }}
- name: Login to ${{ github.event.client_payload.registry }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
registry: ${{ github.event.client_payload.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Image tag
run: |
ver=${{ github.event.client_payload.release_version }}
Expand All @@ -43,11 +41,12 @@ jobs:
OUTPUT_TYPE=type=registry make docker-build-image
env:
VERSION: ${{ env.IMG_TAG }}
REGISTRY: ${{ github.event.client_payload.registry }}

- name: Scan ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMG_TAG }}
- name: Scan ${{ github.event.client_payload.registry }}/${{ env.IMAGE_NAME }}:${{ env.IMG_TAG }}
uses: aquasecurity/trivy-action@master
with:
image-ref: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMG_TAG }}"
image-ref: "${{ github.event.client_payload.registry }}/${{ env.IMAGE_NAME }}:${{ env.IMG_TAG }}"
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/publish-init-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ permissions:
actions: read

env:
REGISTRY: ghcr.io
# Common versions
GO_VERSION: '1.20'
INIT_IMAGE_NAME: 'init-validation'

jobs:
publish-init-images:
env:
REGISTRY: ${{ github.event.client_payload.registry }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -34,10 +31,10 @@ jobs:
fetch-depth: 0
ref: ${{ steps.get-tag.outputs.tag }}

- name: Login to ${{ env.REGISTRY }}
- name: Login to ${{ github.event.client_payload.registry }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
registry: ${{ github.event.client_payload.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -50,11 +47,12 @@ jobs:
OUTPUT_TYPE=type=registry make docker-build-init-image
env:
INIT_IMG_TAG: ${{ env.INIT_IMG_TAG }}
REGISTRY: ${{ github.event.client_payload.registry }}

- name: Scan ${{ env.REGISTRY }}/${{ env.INIT_IMAGE_NAME }}:${{ env.INIT_IMG_TAG }}
- name: Scan ${{ github.event.client_payload.registry }}/${{ env.INIT_IMAGE_NAME }}:${{ env.INIT_IMG_TAG }}
uses: aquasecurity/trivy-action@master
with:
image-ref: "${{ env.REGISTRY }}/${{ env.INIT_IMAGE_NAME }}:${{ env.INIT_IMG_TAG }}"
image-ref: "${{ github.event.client_payload.registry }}/${{ env.INIT_IMAGE_NAME }}:${{ env.INIT_IMG_TAG }}"
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand Down

0 comments on commit 2e9b02e

Please sign in to comment.