ci(gitea): exporter SSH_AUTH_SOCK/SSH_AGENT_PID et guard build --ssh
Some checks failed
build-and-push-ext / build_push (push) Has been cancelled
Some checks failed
build-and-push-ext / build_push (push) Has been cancelled
This commit is contained in:
parent
3aaf543175
commit
9ac66c1e16
@ -25,6 +25,9 @@ jobs:
|
|||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
ssh-keyscan git.4nkweb.com >> ~/.ssh/known_hosts 2>/dev/null || true
|
ssh-keyscan git.4nkweb.com >> ~/.ssh/known_hosts 2>/dev/null || true
|
||||||
echo "SSH agent ready: $SSH_AUTH_SOCK"
|
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
|
- name: Compute Docker tag from commit message or fallback
|
||||||
id: tag
|
id: tag
|
||||||
@ -54,7 +57,12 @@ jobs:
|
|||||||
DOCKER_BUILDKIT: "1"
|
DOCKER_BUILDKIT: "1"
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
docker build --target ext --ssh default -t git.4nkweb.com/4nk/lecoffre-front:${{ steps.tag.outputs.TAG }} -f Dockerfile .
|
if [ -n "${SSH_AUTH_SOCK:-}" ]; then
|
||||||
|
docker build --target ext --ssh default -t git.4nkweb.com/4nk/lecoffre-front:${{ 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
|
- name: Push image
|
||||||
shell: bash
|
shell: bash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user