Skip to content

Commit

Permalink
back to dockerhub..
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalerhino committed Oct 19, 2024
1 parent ef0a77b commit 1700534
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.TOKEN }}
- name: Publish container image
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Publish Container Image
uses: docker/build-push-action@v3
with:
push: true
Expand All @@ -56,13 +55,7 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ env.VERSION }}
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
trivy:
name: Run Trivy Scan
Expand All @@ -73,7 +66,7 @@ jobs:
- name: Install Trivy
uses: aquasecurity/[email protected]
with:
image-ref: 'ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}'
image-ref: '${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}'
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand All @@ -90,7 +83,7 @@ jobs:
uses: sigstore/cosign-installer@main
- name: Sign Container Image
run: |
cosign sign --key env://COSIGN_KEY ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
cosign sign --key env://COSIGN_KEY ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
shell: bash
env:
COSIGN_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
Expand All @@ -104,12 +97,12 @@ jobs:
steps:
- name: Check images
run: |
docker buildx imagetools inspect ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
docker pull ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
cosign verify --key env://COSIGN_PUB_KEY ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
docker buildx imagetools inspect ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
docker pull ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
cosign verify --key env://COSIGN_PUB_KEY ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
- uses: anchore/sbom-action@v0
with:
image: ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
image: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
env:
COSIGN_PUB_KEY: ${{secrets.COSIGN_PUBLIC_KEY}}

0 comments on commit 1700534

Please sign in to comment.