Skip to content

Merge pull request #2 from aphp/dev #20

Merge pull request #2 from aphp/dev

Merge pull request #2 from aphp/dev #20

name: build
on:
push:
branches:
- "dev"
tags:
- "v*.*.*"
jobs:
lint-redcap-httpd-shibd:
name: lint-redcap-httpd-shibd
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lint Dockerfile with Hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./httpd-shibd/Dockerfile
override-info: DL3008,DL3018,DL3041,SC2046
failure-threshold: warning
scan-redcap-httpd-shibd:
name: scan-redcap-httpd-shibd
needs: lint-redcap-httpd-shibd
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build container from Dockerfile
run: docker build -t ghcr.io/aphp/redcap-httpd-shibd:${{ github.sha }} ./httpd-shibd
- name: Run Dockle
uses: erzz/dockle-action@v1.4.0
with:
image: ghcr.io/aphp/redcap-httpd-shibd:${{ github.sha }}
report-format: json
failure-threshold: fatal
exit-code: 1
- name: Scan container for vulnerabilities with Trivy
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: 'ghcr.io/aphp/redcap-httpd-shibd:${{ github.sha }}'
format: 'table'
exit-code: '1'
ignore-unfixed: true
scanners: 'vuln,secret,license'
vuln-type: 'os,library'
severity: 'CRITICAL'
push-redcap-httpd-shibd:
name: push-redcap-httpd-shibd
needs: scan-redcap-httpd-shibd
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/aphp/redcap-httpd-shibd
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:httpd-shibd"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}