Skip to content

feat: gauge for uptime and login on startup #27

feat: gauge for uptime and login on startup

feat: gauge for uptime and login on startup #27

Workflow file for this run

---
name: Docker
on:
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: ${{ github.sha }}
permissions:
security-events: write
# issues: write
# pull-requests: write
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
load: true
push: false
tags: ${{ env.IMAGE_NAME }}:${{ env.TEST_TAG }}
- name: Test
run: |
# Docker exporter test
docker run \
-d \
--rm \
--name test \
-p 9922:9922 \
${{ env.IMAGE_NAME }}:${{ env.TEST_TAG }}
sleep 5
REQ_RETURN_CODE=$(curl "http://localhost:9922" -s -o /dev/null -w "%{http_code}")
if [[ "${REQ_RETURN_CODE}" == "200" ]]; then
echo "Success : request received by exporter, get return code 200"
else
echo "Failure : receive return code ${REQ_RETURN_CODE}"
exit 1
fi
- name: Run Trivy for to GitHub Security
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.IMAGE_NAME }}:${{ env.TEST_TAG }}
format: sarif
cache-dir: /tmp/trivy
output: trivy-results.sarif
exit-code: "0"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.IMAGE_NAME }}:${{ env.TEST_TAG }}
format: table
cache-dir: /tmp/trivy
exit-code: "1"
severity: "CRITICAL,HIGH"