mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-10-09 17:39:17 +00:00
b6f619cdcb
* Rename workflow to workflows * Add integration tests to Actions * Upload code coverage after unit test * don't need code coverage when we do a release * Use same Go version as in go.mod * Use same Go version as go.mod
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: Publish
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
jobs:
|
|
publish:
|
|
name: Publish
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- name: Check Out Repo
|
|
uses: actions/checkout@v2
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
- name: Docker meta
|
|
id: docker_meta
|
|
uses: crazy-max/ghaction-docker-meta@v1
|
|
with:
|
|
images: aquasec/kube-bench
|
|
tag-semver: |
|
|
{{version}}
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ./
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
push: true
|
|
tags: |
|
|
${{ steps.docker_meta.outputs.tags }}
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|