Bootstrap Docker in Gitea workflow
Some checks failed
CI / Publish container image (push) Has been cancelled
CI / Lint and build app (push) Has been cancelled

This commit is contained in:
Space-Banane
2026-05-14 17:22:18 +02:00
parent 198c60aa34
commit c0bb487c05
2 changed files with 31 additions and 0 deletions

View File

@@ -36,6 +36,14 @@ jobs:
- name: Build app - name: Build app
run: npm run build run: npm run build
- name: Install Docker if missing
run: |
if ! command -v docker >/dev/null 2>&1; then
curl -fsSL https://get.docker.com | sh
fi
docker --version
docker compose version
- name: Validate compose file - name: Validate compose file
run: docker compose config run: docker compose config
@@ -49,6 +57,27 @@ jobs:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install and start Docker if missing
run: |
if ! command -v docker >/dev/null 2>&1; then
curl -fsSL https://get.docker.com | sh
fi
if ! docker info >/dev/null 2>&1; then
if command -v service >/dev/null 2>&1; then
service docker start || true
fi
if ! docker info >/dev/null 2>&1; then
nohup dockerd >/tmp/dockerd.log 2>&1 &
fi
timeout 60 sh -c 'until docker info >/dev/null 2>&1; do sleep 2; done'
fi
docker --version
docker compose version
- name: Log in to Gitea registry - name: Log in to Gitea registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin

View File

@@ -39,6 +39,8 @@ Required repository or organization secrets:
- `REGISTRY_USERNAME`: Gitea username allowed to publish packages - `REGISTRY_USERNAME`: Gitea username allowed to publish packages
- `REGISTRY_TOKEN`: Gitea personal access token with package read/write access - `REGISTRY_TOKEN`: Gitea personal access token with package read/write access
The workflow installs Docker if it is missing. If your Gitea runner is itself containerized, it still needs either privileged mode for Docker-in-Docker or a mounted host Docker socket.
On pushes to `main`, CI publishes: On pushes to `main`, CI publishes:
```bash ```bash