59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Container Publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
schedule:
|
|
- cron: "0 22 * * *"
|
|
|
|
jobs:
|
|
build-image:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker BuildX
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.libreschool.org
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and publish
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
# load: true # load doesn't work with multiple platforms
|
|
tags: git.libreschool.org/bglug/hugo-extended:latest
|
|
|
|
- name: Run Trivy vulnerability scanner
|
|
id: scan
|
|
uses: aquasecurity/trivy-action@master
|
|
with:
|
|
image-ref: "git.libreschool.org/bglug/hugo-extended:latest"
|
|
format: "json"
|
|
output: "trivy-results.json"
|
|
|
|
- name: check output
|
|
run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi
|
|
|
|
- name: Build and publish
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: git.libreschool.org/bglug/hugo-extended:latest
|