Skip to content

Commit

Permalink
feat(ci): add workflow to upload github-actions image to dockerhub (C…
Browse files Browse the repository at this point in the history
…heckmarx#4564)

Signed-off-by: João Reigota <[email protected]>
  • Loading branch information
joaoReigota1 authored Nov 26, 2021
1 parent 5beeb35 commit 8e30e48
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/release-docker-github-actions.yaml
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

0 comments on commit 8e30e48

Please sign in to comment.