Skip to content

Commit

Permalink
Add publish task
Browse files Browse the repository at this point in the history
  • Loading branch information
andifalk committed Oct 8, 2023
1 parent 63329f4 commit bb85eef
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,21 @@ jobs:
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
run: docker build . --file Dockerfile --platform linux/amd64 --tag "andifalk/supply-chain-security:${{ tag_name }}"
- name: Push image
run: docker push "andifalk/supply-chain-security:${{ tag_name }}"
- name: Install Cosign
uses: sigstore/[email protected]
- name: Sign image with a key
run: cosign sign --yes --key env://COSIGN_PRIVATE_KEY "${TAGS}@${DIGEST}"
env:
TAGS: ${{ tag_name }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
DIGEST: ${{ steps.build-image.outputs.digest }}

0 comments on commit bb85eef

Please sign in to comment.