ci: docker_tag=ext - Supprimer workflow CI incorrect (pas de Dockerfile)
This commit is contained in:
parent
bd1afdabab
commit
1fce2df474
@ -1,73 +0,0 @@
|
|||||||
name: build-and-push-ext
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- ext
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Prepare SSH agent (optional)
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
eval "$(ssh-agent -s)"
|
|
||||||
if [ -n "${{ secrets.SSH_PRIVATE_KEY || '' }}" ]; then
|
|
||||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add - >/dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
ssh-keyscan git.4nkweb.com >> ~/.ssh/known_hosts 2>/dev/null || true
|
|
||||||
echo "SSH agent ready: $SSH_AUTH_SOCK"
|
|
||||||
# Rendre l'agent dispo aux steps suivants
|
|
||||||
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
|
|
||||||
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Compute Docker tag from commit message or fallback
|
|
||||||
id: tag
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
msg=$(git log -1 --pretty=%B)
|
|
||||||
if [[ "$msg" =~ ci:\ docker_tag=([a-zA-Z0-9._:-]+) ]]; then
|
|
||||||
tag="${BASH_REMATCH[1]}"
|
|
||||||
else
|
|
||||||
tag="ext"
|
|
||||||
fi
|
|
||||||
echo "TAG=$tag" | tee -a $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Docker login (git.4nkweb.com)
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
REG_USER: ${{ secrets.USER }}
|
|
||||||
REG_TOKEN: ${{ secrets.TOKEN }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
echo "$REG_TOKEN" | docker login git.4nkweb.com -u "$REG_USER" --password-stdin
|
|
||||||
|
|
||||||
- name: Build image (target ext)
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
DOCKER_BUILDKIT: "1"
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
if [ -n "${SSH_AUTH_SOCK:-}" ]; then
|
|
||||||
docker build --target ext --ssh default \
|
|
||||||
-t git.4nkweb.com/4nk/lecoffre_node:${{ steps.tag.outputs.TAG }} \
|
|
||||||
-f Dockerfile .
|
|
||||||
else
|
|
||||||
echo "SSH_AUTH_SOCK non défini: l'agent SSH n'est pas disponible. Assurez-vous de définir secrets.SSH_PRIVATE_KEY."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Push image
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
docker push git.4nkweb.com/4nk/lecoffre_node:${{ steps.tag.outputs.TAG }}
|
|
Loading…
x
Reference in New Issue
Block a user