fix: remove unneeded caching from website (#5392)
All checks were successful
continuous-integration/drone/push Build is passing

In #5333 I added docker image caching using Gitea artifact Registry.

This turned out to be a waste of time, that actually slowed things down.

This is because the docker instance on the drone runner host actually caches the images internally anyway, so the time cost of downloading an image, rebuilding it and re pushing it was being paid for no reason or benefit.

This pr removes the caching, but does translate a step to ensure that the build docker container can be built in a pr, which is a good check to have pre merge to master.

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5392
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
This commit is contained in:
2025-10-09 11:30:25 +00:00
committed by tobiasd
parent 52317feb42
commit 7606e2588a

View File

@@ -7,76 +7,6 @@ clone:
depth: 150
steps:
# Build and push build container on master
- name: docker-build-push-build
image: plugins/docker
settings:
username: git-robot
password:
from_secret: git_robot_password
repo: git.fsfe.org/fsfe/fsfe-website-build
registry: git.fsfe.org/fsfe/fsfe-website-build
tags: latest
cache_from: git.fsfe.org/fsfe/fsfe-website-build:latest
dockerfile: build.Dockerfile
when:
branch:
- master
event:
- push
# Build and push pre-commit container on master
- name: docker-build-push-pre-commit
image: plugins/docker
settings:
username: git-robot
password:
from_secret: git_robot_password
repo: git.fsfe.org/fsfe/fsfe-website-pre-commit
registry: git.fsfe.org/fsfe/fsfe-website-pre-commit
tags: latest
cache_from: git.fsfe.org/fsfe/fsfe-website-pre-commit:latest
dockerfile: pre-commit.Dockerfile
when:
branch:
- master
event:
- push
# Build but do not push build container on PR
- name: docker-build-pr-build
image: plugins/docker
settings:
username: git-robot
password:
from_secret: git_robot_password
repo: git.fsfe.org/fsfe/fsfe-website-build
registry: git.fsfe.org/fsfe/fsfe-website-build
tags: latest
cache_from: git.fsfe.org/fsfe/fsfe-website-build:latest
dockerfile: build.Dockerfile
dry_run: true
when:
event:
- pull_request
# Build but do not push pre-commit container on PR
- name: docker-build-pr-pre-commit
image: plugins/docker
settings:
username: git-robot
password:
from_secret: git_robot_password
repo: git.fsfe.org/fsfe/fsfe-website-pre-commit
registry: git.fsfe.org/fsfe/fsfe-website-pre-commit
tags: latest
cache_from: git.fsfe.org/fsfe/fsfe-website-pre-commit:latest
dockerfile: pre-commit.Dockerfile
dry_run: true
when:
event:
- pull_request
- name: pre-commit
image: docker:27.4.1
environment:
@@ -93,6 +23,23 @@ steps:
- echo "DRONE_COMMIT_BRANCH ${DRONE_COMMIT_BRANCH}"
- docker compose -p fsfe-website-pre-commit run --remove-orphans --build pre-commit "origin/${DRONE_COMMIT_BRANCH}"
# Test building the deploy docker image
- name: test-build-docker-image
image: docker:27.4.1
environment:
# Environment variables necessary for rootless Docker
XDG_RUNTIME_DIR: "/run/user/1001"
DOCKER_HOST: "unix:///run/user/1001/docker.sock"
volumes:
# Mounting Docker socket of rootless docker user
- name: dockersock
path: /run/user/1001/docker.sock
commands:
- docker compose build build
when:
event:
- pull_request
- name: push-to-docs
image: git.fsfe.org/fsfe-system-hackers/docs-centralizer:latest
environment:
@@ -195,4 +142,6 @@ volumes:
path: /run/user/1001/docker.sock
---
kind: signature
hmac: 25f45a057596782206dca10db43afd17972a5b42c799f242afcff9ae516808d5
hmac: 997582ae47807c3367efcda28920c2d0f84bfd05d6fddf224bf7440a636d91e1
...