protonmail-bridge-nextcoud-.../.github/workflows/deb.yaml
2026-03-11 11:47:53 -05:00

78 lines
1.9 KiB
YAML

name: pack from deb
on:
push:
paths:
- .github/workflows/deb.yaml
- deb/*
- VERSION
pull_request:
paths:
- .github/workflows/deb.yaml
- deb/*
workflow_dispatch:
env:
GHCR_REPO: ghcr.io/trent-maetzold/protonmail-bridge
jobs:
deb:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version
run: echo "version=$(cat VERSION)" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GHCR_REPO }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image without push
uses: docker/build-push-action@v6
with:
context: ./deb
file: ./deb/Dockerfile
load: true
tags: protonmail-bridge:latest
- name: Run Trivy vulnerability scan
uses: aquasecurity/trivy-action@0.30.0
with:
image-ref: protonmail-bridge:latest
format: 'sarif'
exit-code: 0
severity: 'CRITICAL,HIGH'
output: 'trivy-results.sarif'
- name: Upload Trivy scan SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
- name: Login to GHCR
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
uses: docker/build-push-action@v6
if: github.event_name != 'pull_request'
with:
context: ./deb
file: ./deb/Dockerfile
tags: |
${{ env.GHCR_REPO }}:latest
${{ env.GHCR_REPO }}:${{ env.version }}
labels: ${{ steps.meta.outputs.labels }}
push: true