Skip to content

Build & Push

Build & Push #219

name: Build & Push
on:
schedule:
# https://github.com/bored-engineer/trivy-offline/blob/2f477b04d628de366c15c6c2668c6c30831b4176/.github/workflows/build-and-push.yml#L7
- cron: '35 */6 * * *'
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: bored-engineer
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Build and Push (amd64)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
provenance: false
tags: ghcr.io/bored-engineer/trivy-lambda:latest-amd64
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and Push (arm64)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
push: true
provenance: false
tags: ghcr.io/bored-engineer/trivy-lambda:latest-arm64
cache-from: type=gha
cache-to: type=gha,mode=max