Files
AudioManager/.gitea/workflows/ci.yaml
T
TapTap a0434d974f
CI / test (push) Successful in 1m37s
CI / chart (push) Successful in 2s
CI / image (push) Failing after 2m42s
ci: build images with kaniko inside the job image
The runner does not expose its Docker socket to job containers, so the
image job could not run docker build. Include the kaniko executor in the
CI image and build/push directly from the job; docker login only writes
the registry credentials file.

Bump the CI image tag to 2.
2026-11-13 13:52:49 +00:00

85 lines
2.3 KiB
YAML

name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
env:
REGISTRY: gitea.tap-tap.win
IMAGE_NAME: taptap/audiomanager
# Built by scripts/build-ci-image.sh from ci/Dockerfile. Bump the tag when
# ci/Dockerfile changes.
CI_IMAGE: gitea.tap-tap.win/taptap/audiomanager-ci:2
jobs:
test:
runs-on: ubuntu-latest
container:
image: gitea.tap-tap.win/taptap/audiomanager-ci:2
steps:
- uses: actions/checkout@v4
- name: Test
run: gradle test --console=plain
- name: Smoke test
run: GRADLE=gradle ./scripts/smoke.sh
chart:
runs-on: ubuntu-latest
container:
image: gitea.tap-tap.win/taptap/audiomanager-ci:2
steps:
- uses: actions/checkout@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
- chart
if: github.event_name == 'push'
runs-on: ubuntu-latest
container:
image: gitea.tap-tap.win/taptap/audiomanager-ci:2
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to the registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD || secrets.GITEA_TOKEN }}" \
| docker login "$REGISTRY" \
--username "${{ secrets.REGISTRY_USERNAME || gitea.actor }}" \
--password-stdin
- name: Build and push
run: |
set -euo pipefail
tags=("$REGISTRY/$IMAGE_NAME:sha-${GITHUB_SHA::7}")
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
tags+=("$REGISTRY/$IMAGE_NAME:${GITHUB_REF_NAME}")
else
tags+=("$REGISTRY/$IMAGE_NAME:latest")
fi
destinations=()
for tag in "${tags[@]}"; do
destinations+=(--destination "$tag")
done
# Kaniko builds without a Docker daemon. docker login wrote the
# credentials to the default Docker config location.
mkdir -p /kaniko/.docker
cp "$HOME/.docker/config.json" /kaniko/.docker/config.json
kaniko-executor \
--context="dir://$PWD" \
--dockerfile="$PWD/Dockerfile" \
--snapshot-mode=redo \
"${destinations[@]}"