Skip to content

Commit

Permalink
Add CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Oct 9, 2023
1 parent 80c7b97 commit 45b6bdd
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and publish a 🛢️ container

on:
push:
paths-ignore:
- '.github/**'
branches:
- 'main'
tags:
- '*'

jobs:
build-and-push-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: voxpupuli/gha-build-and-publish-a-container@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_arch: linux/amd64,linux/arm64
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---

on:
pull_request: {}
push:
branches:
- main

name: CI

jobs:
build_docker_image:
name: 'Built test Docker image'
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'puppetdb'
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
tags: 'ci/hdm:${{ github.sha }}'
push: false

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ci/hdm:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'

tests:
needs:
- build_docker_image
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed

0 comments on commit 45b6bdd

Please sign in to comment.