Nicolas Cantu 42e79e5698
Some checks failed
dev-test-2 / build-and-push (push) Failing after 5s
dev / build-and-push (push) Failing after 8s
ci: run on ubuntu-latest; assert docker availability instead of installing
2025-09-10 13:37:36 +02:00

76 lines
2.5 KiB
YAML

name: dev
on:
push:
branches:
- '*'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up SSH agent
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Trust Gitea host and force SSH for git.4nkweb.com
run: |
ssh-keyscan -H git.4nkweb.com >> ~/.ssh/known_hosts
git config --global url.ssh://git@git.4nkweb.com/.insteadOf https://git.4nkweb.com/
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
- name: Login to Gitea Registry
uses: docker/login-action@v3
with:
registry: git.4nkweb.com
username: ${{ secrets.USER }}
password: ${{ secrets.TOKEN }}
- name: Init submodules (ensure up-to-date)
run: |
git submodule sync --recursive
git submodule update --init --recursive
- name: Debug workspace
run: |
pwd
ls -la
git rev-parse --abbrev-ref HEAD || true
if [ -f .gitmodules ]; then echo ".gitmodules present"; cat .gitmodules; else echo "NO .gitmodules"; fi
git submodule status || true
- name: Docker info
run: |
which docker || true
if ! command -v docker >/dev/null 2>&1; then
echo "Docker n'est pas disponible sur ce runner (ubuntu-latest)." >&2
exit 1
fi
docker version
docker info
- name: Build and push images
env:
REGISTRY: git.4nkweb.com
run: |
DOCKER_TAG=$(git rev-parse --abbrev-ref HEAD)
bash scripts/build_and_push.sh "$DOCKER_TAG"
- name: Show logs summary
if: always()
run: |
DOCKER_TAG=$(git rev-parse --abbrev-ref HEAD)
if [ -f "log/ci/${DOCKER_TAG}/summary.txt" ]; then
echo "=== Summary for ${DOCKER_TAG} ==="
cat "log/ci/${DOCKER_TAG}/summary.txt"
else
echo "No summary found for ${DOCKER_TAG}"
fi
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-logs-${{ github.ref_name || 'branch' }}
path: log/ci/**
if-no-files-found: ignore