93 lines
2.5 KiB
YAML
93 lines
2.5 KiB
YAML
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
|
|
# The runner executes jobs in containers; expose its Docker daemon so the
|
|
# image build works without a separate DinD service.
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
options: --volume /var/run/docker.sock:/var/run/docker.sock
|
|
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 }}
|