Simplify publish workflow for Gitea runner
All checks were successful
Publish / Test, build, and push image (push) Successful in 2m39s
All checks were successful
Publish / Test, build, and push image (push) Successful in 2m39s
This commit is contained in:
parent
c8692d4348
commit
c8bd5754ba
@ -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 \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user