73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
name: Build startup image
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
# Use docker.io for Docker Hub if empty
|
|
REGISTRY: cs-registry.ddnss.de
|
|
USER: chris
|
|
PASS: q',\H(Od:G3).Xv<#!5P
|
|
|
|
|
|
jobs:
|
|
Build-and-release-image:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Log into registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: https://cs-git.ddnss.de
|
|
username: ${{ env.USER }}
|
|
password: ${{ env.PASS }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: cs-git.ddnss.de/ri-st/startup
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v4
|
|
env:
|
|
ACTIONS_RUNTIME_TOKEN: ''
|
|
with:
|
|
tags: cs-git.ddnss.de/ri-st/startup:latest
|
|
push: true
|
|
|
|
- name: Build and store image for trivy
|
|
uses: docker/build-push-action@v4
|
|
env:
|
|
ACTIONS_RUNTIME_TOKEN: ''
|
|
with:
|
|
outputs: type=docker,dest=/tmp/startup.tar
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: myimage
|
|
path: /tmp/myimage.tar
|
|
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: myimage
|
|
path: /tmp
|
|
|
|
- name: Check with trivy
|
|
uses: aquasecurity/trivy-action@master
|
|
with:
|
|
scan-ref: '/tmp/startup.tar'
|
|
scan-type: 'fs'
|
|
format: 'table'
|
|
vuln-type: 'os,library'
|