ci: keep tests in CI and move image pushes to a local release script
The Gitea registry rejects kaniko pushes from job containers with 401 reqPackageAccess even though the same credentials work from a normal machine, so the image job could never go green. Drop the image job; CI now only runs unit tests, the smoke test and the Helm chart lint. Add scripts/release.sh, which builds and pushes the image from a trusted machine and can optionally apply the users secret and run helm upgrade.
This commit is contained in:
1 parent
9eed647df0
commit
60e8dadce6
3 files changed
+93
-55
No files matched your search
@@ -10,8 +10,6 @@ on:
|
||||
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
|
||||
@@ -38,48 +36,3 @@ jobs:
|
||||
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.AUDIOMANAGER_REGISTRY_TOKEN }}" \
|
||||
| docker login "$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[@]}"
|
||||
Reference in new issue
Block a user