Skip to content

Added trivy to push github action workflow. #16

Added trivy to push github action workflow.

Added trivy to push github action workflow. #16

Workflow file for this run

name: CI
on:
pull_request:
branches: [master]
jobs:
build:
name: Test Build
runs-on: "ubuntu-latest"
defaults:
run:
working-directory: .
steps:
- name: Checking out the repository
uses: actions/checkout@v2
- name: Set up Docker Context for Buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Builder
uses: docker/setup-buildx-action@v1
with:
version: latest
install: true
endpoint: builders
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: arm64,amd64
- 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: Build Image
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: okteto/bin:latest
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'okteto/bin:1.6.0'
format: 'table'
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache