Simplify publish workflow for Gitea runner
All checks were successful
Publish / Test, build, and push image (push) Successful in 2m39s

This commit is contained in:
V 2026-05-16 21:45:52 +01:00
parent c8692d4348
commit c8bd5754ba

View File

@ -6,8 +6,8 @@ on:
- main - main
jobs: jobs:
lint-test: publish:
name: Lint and test name: Test, build, and push image
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: golang:1.24-bookworm image: golang:1.24-bookworm
@ -41,27 +41,6 @@ jobs:
- name: Test - name: Test
run: go test ./... run: go test ./...
build-push:
name: Build and push image
runs-on: ubuntu-latest
needs: lint-test
container:
image: docker:27-git
steps:
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
set -eu
git init .
if [ -n "${TOKEN:-}" ]; then
git remote add origin "https://x-access-token:${TOKEN}@k3gtpi.jumpingcrab.com/${GITHUB_REPOSITORY}.git"
else
git remote add origin "https://k3gtpi.jumpingcrab.com/${GITHUB_REPOSITORY}.git"
fi
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout --detach FETCH_HEAD
- name: Read version - name: Read version
run: | run: |
version="$(tr -d '[:space:]' < VERSION)" version="$(tr -d '[:space:]' < VERSION)"
@ -72,6 +51,12 @@ jobs:
echo "VERSION=$version" >> "$GITHUB_ENV" echo "VERSION=$version" >> "$GITHUB_ENV"
echo "IMAGE=k3crpi.jumpingcrab.com:5000/sabisan:$version" >> "$GITHUB_ENV" echo "IMAGE=k3crpi.jumpingcrab.com:5000/sabisan:$version" >> "$GITHUB_ENV"
- name: Install Docker CLI
run: |
apt-get update
apt-get install -y --no-install-recommends docker.io
rm -rf /var/lib/apt/lists/*
- name: Log in to registry - name: Log in to registry
run: | run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login k3crpi.jumpingcrab.com:5000 \ echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login k3crpi.jumpingcrab.com:5000 \