Skip to content

Commit

Permalink
Action Updates (#75)
Browse files Browse the repository at this point in the history
* GitHub action uses updates

* Docker login and push must be on source project only

---------

Co-authored-by: datadot <[email protected]>
  • Loading branch information
datadot and datadot authored Jul 6, 2024
1 parent 5f04da1 commit d26021f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker-image.v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
id: buildx
Expand Down Expand Up @@ -70,11 +70,13 @@ jobs:
docker tag $CLAIR_LOCAL_SCAN_IMAGE ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA}
docker images
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.repository_owner == 'arminc'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push images
if: github.repository_owner == 'arminc'
run: |
docker push ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA}
docker push $CLAIR_LOCAL_SCAN_IMAGE:latest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docker-image.v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Runner diskspace workaround
run: |
Expand Down Expand Up @@ -88,11 +88,13 @@ jobs:
docker tag $CLAIR_LOCAL_SCAN_IMAGE ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA}
docker images
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.repository_owner == 'arminc'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push images
if: github.repository_owner == 'arminc'
run: |
docker push ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA}
docker push $CLAIR_LOCAL_SCAN_IMAGE:latest
Expand Down

0 comments on commit d26021f

Please sign in to comment.