manual ci script + no cache for map updates

This commit is contained in:
Hadrien 2026-07-03 23:33:48 +02:00
parent a5cf3640dd
commit 564a22abb2
5 changed files with 58 additions and 10 deletions

View file

@ -13,10 +13,9 @@ jobs:
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | podman login git.interhacker.space --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build Container Image
- name: Build and Push Container Image
run: |
trap 'rm -f dist.zip' EXIT
wget -q -O dist.zip https://git.interhacker.space/epickiwi/2026.camp.carte/releases/download/latest/dist.zip
podman build -t git.interhacker.space/interhack/camp-website-2026:latest .
- name: Push Container Image
run: |
podman push git.interhacker.space/interhack/camp-website-2026:latest

1
.gitignore vendored
View file

@ -1 +1,2 @@
guide.html
dist.zip

View file

@ -1,13 +1,12 @@
FROM docker.io/nginx:1.29-alpine
RUN apk add --update --no-cache wget unzip bash pandoc sed
RUN apk add --update --no-cache unzip bash pandoc sed
RUN wget -q https://git.interhacker.space/epickiwi/2026.camp.carte/releases/download/latest/dist.zip
RUN unzip -q dist.zip -d /tmp/carte
COPY dist.zip /tmp/dist.zip
RUN unzip -q /tmp/dist.zip -d /tmp/carte
RUN mkdir -p /usr/share/nginx/html/carte
RUN cp -r /tmp/carte/dist/* /usr/share/nginx/html/carte/
RUN rm -rf /tmp/carte
RUN rm -rf dist.zip
RUN rm -rf /tmp/carte /tmp/dist.zip
COPY guide.template.html .
COPY update-guide.sh .

View file

@ -40,11 +40,13 @@ First, login to the Docker registry:
docker login git.interhacker.space
```
Then, build and push to the registry:
Then, download the map bundle, build and push to the registry:
```bash
wget -q -O dist.zip https://git.interhacker.space/epickiwi/2026.camp.carte/releases/download/latest/dist.zip
docker build -t git.interhacker.space/interhack/camp-website-2026:latest .
docker push git.interhacker.space/interhack/camp-website-2026:latest
rm -f dist.zip
```
The pull process is triggered every five minutes.

47
manual-ci.sh Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -euo pipefail
IMAGE="git.interhacker.space/interhack/camp-website-2026:latest"
REGISTRY="git.interhacker.space"
need_cmd() {
command -v "$1" >/dev/null 2>&1 || {
echo "Missing required command: $1" >&2
exit 1
}
}
need_cmd bash
need_cmd wget
need_cmd pandoc
need_cmd docker
if [[ ! -x ./update-guide.sh ]]; then
echo "Missing or non-executable ./update-guide.sh" >&2
exit 1
fi
echo "==> Generating guide.html"
bash ./update-guide.sh
trap 'rm -f dist.zip' EXIT
echo "==> Downloading map bundle"
wget -q -O dist.zip https://git.interhacker.space/epickiwi/2026.camp.carte/releases/download/latest/dist.zip
echo "==> Logging in to ${REGISTRY}"
if [[ -n "${DOCKER_USERNAME:-}" && -n "${DOCKER_PASSWORD:-}" ]]; then
printf '%s' "$DOCKER_PASSWORD" | docker login "$REGISTRY" --username "$DOCKER_USERNAME" --password-stdin
else
docker login "$REGISTRY"
fi
echo "==> Building image: ${IMAGE}"
docker build --no-cache -t "$IMAGE" .
echo "==> Pushing image: ${IMAGE}"
docker push "$IMAGE"
rm -f dist.zip
echo "Done."