forked from zricethezav/kics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add workflow to upload github-actions image to dockerhub (C…
…heckmarx#4564) Signed-off-by: João Reigota <[email protected]>
- Loading branch information
1 parent
5beeb35
commit 8e30e48
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: release-docker-github-action | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version To push" | ||
required: true | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker GitHub Actions image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Check out the tag | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.inputs.version }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
image: tonistiigi/binfmt:latest | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Push Github Action Image to Docker Hub | ||
uses: docker/[email protected] | ||
id: build_gh_action | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: checkmarx/kics:gh-action | ||
build-args: | | ||
VERSION=${{ github.event.inputs.version }} | ||
COMMIT=${{ github.sha }} | ||
SENTRY_DSN=${{ secrets.SENTRY_DSN }} | ||
DESCRIPTIONS_URL=${{ secrets.DESCRIPTIONS_URL }} | ||
- name: Check out the repo | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Export Image Digests | ||
run: | | ||
VERSION=${{ github.event.inputs.version }} | ||
DIGEST=${{ steps.build_gh_action.outputs.digest }} | ||
echo "${VERSION}-gh-actions,${DIGEST}" >> docs/docker/digests.csv | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: 3.x | ||
- name: Generate .md table | ||
run: | | ||
pip install csvtomd | ||
csvtomd docs/docker/digests.csv > docs/docker/digests.md | ||
- name: Create Pull Request | ||
uses: peter-evans/[email protected] | ||
with: | ||
title: "docs(kicsbot): update images digest" | ||
token: ${{ secrets.KICS_BOT_PAT }} | ||
commit-message: "docs(kicsbot): update github-action image digest" | ||
delete-branch: true | ||
branch: feature/kicsbot-update-gh-actions-digest | ||
body: | | ||
**Automated Changes** | ||
Updating docker github-action image digest | ||
Triggered by SHA: _${{ github.sha }}_ | ||
labels: documentation |