ci: docker_tag=ext sanitize tag extraction; add .gitea workflow; push image to ext
This commit is contained in:
parent
2d3ac5a884
commit
7681c9966b
44
.gitea/workflows/docker-build.yml
Normal file
44
.gitea/workflows/docker-build.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: Docker Build and Push (ext)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- ext
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Derive DOCKER_TAG from commit message or fallback
|
||||||
|
id: tag
|
||||||
|
run: |
|
||||||
|
msg=$(git log -1 --pretty=%B | tr -d '\r')
|
||||||
|
tag=$(printf '%s' "$msg" | sed -n 's/.*docker_tag=\([A-Za-z0-9._-]\+\).*/\1/p' | head -n1)
|
||||||
|
if [ -z "$tag" ]; then tag=dev-test; fi
|
||||||
|
tag=$(printf '%s' "$tag" | tr -d '[:space:]')
|
||||||
|
echo "DOCKER_TAG=$tag" >> $GITHUB_ENV
|
||||||
|
echo "tag=$tag" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.4nkweb.com
|
||||||
|
username: ${{ secrets.USER }}
|
||||||
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
git.4nkweb.com/4nk/ihm_client:${{ env.DOCKER_TAG }}
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user