ci: docker_tag=ext | Gitea Actions build/push image ext
Some checks failed
Build and Push Docker image (ext) / docker (push) Failing after 21s
Some checks failed
Build and Push Docker image (ext) / docker (push) Failing after 21s
This commit is contained in:
parent
e6569cf908
commit
17e2cd282e
57
.gitea/workflows/docker-ext.yml
Normal file
57
.gitea/workflows/docker-ext.yml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
name: Build and Push Docker image (ext)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev4
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.4nkweb.com
|
||||||
|
IMAGE_NAMESPACE: 4nk
|
||||||
|
IMAGE_NAME: ihm_client
|
||||||
|
DOCKER_TAG: ext
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Extract docker tag from commit message (optional)
|
||||||
|
id: tag
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
MSG=$(git log -1 --pretty=%B | tr -d '\r')
|
||||||
|
if echo "$MSG" | grep -q "ci: docker_tag="; then
|
||||||
|
T=$(echo "$MSG" | sed -nE 's/.*ci: docker_tag=([^ ]+).*/\1/p' | tr -d '\n')
|
||||||
|
if [ -n "$T" ]; then
|
||||||
|
echo "tag=$T" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: |
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag || env.DOCKER_TAG }}
|
||||||
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user