Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/frontend #19

Merged
merged 16 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions .github/workflows/build-frontend.yml

This file was deleted.

87 changes: 0 additions & 87 deletions .github/workflows/build-persistence.yml

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/build-serving.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/build-test-push-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build, Test and Push Frontend to GitHub Container Registry
on:
push:
branches: [ "main", "dev", "feature/frontend" ]
pull_request:
branches: [ "main", "dev" ]
workflow_dispatch:

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
strategy:
matrix:
component: [ frontend ]
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to the Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine Semantic Version
uses: paulhatch/semantic-version@v5.4.0
id: semantic-version
with:
tag_prefix: "v"
major_pattern: "(MAJOR-${{ matrix.component }})"
minor_pattern: "(MINOR-${{ matrix.component }})"
change_path: "${{ matrix.component }}"
version_format: "v${major}.${minor}.${patch}+${increment}"
namespace: ${{ matrix.component }}

- name: Build Docker Image
id: docker-build
uses: docker/build-push-action@v5.3.0
with:
context: ./${{ matrix.component }}
load: true
file: ./${{ matrix.component }}/Dockerfile

- name: Run Trivy Vulnerability Scanner
id: scan
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ steps.docker-build.outputs.imageid }}
format: 'table'
severity: HIGH,CRITICAL
exit-code: 1

- name: Upload SARIF file
if: ${{ steps.scan.outputs.sarif != '' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

- name: Extract Metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.component }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
type=raw,value=${{ steps.semantic-version.outputs.version }}

- name: Push Docker Image
id: docker-push
uses: docker/build-push-action@v5.3.0
with:
context: ./${{ matrix.component }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading
Loading