From 92d120124c46f82fc59406ad7024e716184a9e8e Mon Sep 17 00:00:00 2001 From: Brian Bicknell Date: Sun, 2 Nov 2025 21:51:18 -0500 Subject: [PATCH] Publish image testing. --- .gitea/workflows/ci.yml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e991051..57598e6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -6,6 +6,7 @@ on: jobs: build-test: + if: ${{ false }} # disabled for now runs-on: [self-hosted, linux, x64, docker] container: image: ghcr.io/catthehacker/ubuntu:act-latest @@ -26,4 +27,37 @@ jobs: - run: dotnet restore - run: dotnet build --configuration Release --no-restore - - run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx" \ No newline at end of file + - run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx" + + publish-image: + runs-on: [self-hosted, linux, x64, docker] + env: + REGISTRY: ${{ secrets.REGISTRY_HOST }} + OWNER_REPO: ${{ github.repository }} + steps: + - uses: actions/checkout@v4 + + - name: Normalize image name (lowercase) + id: names + run: | + IMAGE_LC="$(echo "${REGISTRY}/${OWNER_REPO}" | tr '[:upper:]' '[:lower:]')" + echo "image=${IMAGE_LC}" >> "$GITHUB_OUTPUT" + + - name: Docker login + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" \ + | docker login "${{ env.REGISTRY }}" \ + -u "${{ secrets.REGISTRY_USER }}" \ + --password-stdin + + - name: Enable BuildKit + run: echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV + + - name: Build + run: docker build -t "${{ steps.names.outputs.image }}:${{ github.sha }}" . + + - name: Push + run: | + docker push "${{ steps.names.outputs.image }}:${{ github.sha }}" + docker tag "${{ steps.names.outputs.image }}:${{ github.sha }}" "${{ steps.names.outputs.image }}:latest" + docker push "${{ steps.names.outputs.image }}:latest" \ No newline at end of file