feat: add Docker image, Helm chart and Gitea CI
- multi-stage Dockerfile with ffmpeg on Alpine JRE 21 - Helm chart for k3s: library ConfigMap, Vault users secret, data PVC, read-only hostPath media, ingress, probes and security context - Gitea Actions runs tests, smoke test and chart lint, then builds and pushes the image on main and version tags
This commit is contained in:
1 parent
18a1d7cd19
commit
25331ec0e1
12 files changed
+494
-11
No files matched your search
@@ -0,0 +1,87 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*"
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
REGISTRY: gitea.tap-tap.win
|
||||
IMAGE_NAME: tap-tap/audiomanager
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
- name: Install ffmpeg
|
||||
run: sudo apt-get update && sudo apt-get install -y ffmpeg
|
||||
- name: Test
|
||||
run: ./gradlew test --console=plain
|
||||
|
||||
smoke:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
- name: Install ffmpeg and sqlite
|
||||
run: sudo apt-get update && sudo apt-get install -y ffmpeg sqlite3
|
||||
- name: Smoke test
|
||||
run: ./scripts/smoke.sh
|
||||
|
||||
chart:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: azure/setup-helm@v4
|
||||
- name: Lint and render the chart
|
||||
run: |
|
||||
helm lint charts/musicmanager
|
||||
helm template musicmanager charts/musicmanager --set users.existingSecret=test > /dev/null
|
||||
|
||||
image:
|
||||
needs:
|
||||
- test
|
||||
- smoke
|
||||
- chart
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Log in to the registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME || gitea.actor }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITEA_TOKEN }}
|
||||
- name: Image metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=sha
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
Reference in new issue
Block a user