Skip to content

Commit

Permalink
modify workflow to improve
Browse files Browse the repository at this point in the history
  • Loading branch information
githubofkrishnadhas committed Jul 11, 2024
1 parent c659e2e commit 2e1dce1
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/build-publish-jenkins-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,21 @@ jobs:
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jenkins-core-image:${{ env.NEW_VERSION }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-core-image:${{ env.NEW_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/jenkins-core-image:latest
build-args: |
"JENKINS_USER=${{ secrets.JENKINS_USER }}"
"JENKINS_PASS=${{ secrets.JENKINS_PASS }}"
"GITHUB_APP_KEY=${{ secrets.GH_APP_KEY }}"
"GITHUB_APP_ID=${{ secrets.GH_APP_ID }}"
- name: Build and Publish docker image with latest tag
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jenkins-core-image:latest
build-args: |
"JENKINS_USER=${{ secrets.JENKINS_USER }}"
"JENKINS_PASS=${{ secrets.JENKINS_PASS }}"
"GITHUB_APP_KEY=${{ secrets.GH_APP_KEY }}"
"GITHUB_APP_ID=${{ secrets.GH_APP_ID }}"
"GITHUB_APP_ID=${{ secrets.GH_APP_ID }}"
- name: set up docker and scan docker image for vulnerabilities
uses: docker-practice/actions-setup-docker@master
- run: |
set -x
docker version
docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image ${{ secrets.DOCKERHUB_USERNAME }}/jenkins-core-image:latest
docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image ${{ secrets.DOCKERHUB_USERNAME }}/jenkins-core-image:latest
- name: Set job end time
run: echo "JOB_END_TIME=$(date -u +"%d %B %A %Y %H:%M UTC")" >> $GITHUB_ENV
Expand Down

0 comments on commit 2e1dce1

Please sign in to comment.