# Build and publish the per-repo CI base image to the Gitea container registry. name: Build CI Image on: schedule: - cron: "0 2 * * *" workflow_dispatch: push: branches: - main paths: - pyproject.toml - uv.lock - docker/ci/** env: REGISTRY: gitea.lille-vemmelund.dk REGISTRY_USER: ci-bot IMAGE: gitea.lille-vemmelund.dk/lille-vemmelund/python-repositories-ci jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Log in to Gitea container registry env: CI_RUNNER_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }} run: | echo "$CI_RUNNER_TOKEN" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin - name: Build CI image env: CI_RUNNER_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }} run: | echo "$CI_RUNNER_TOKEN" > /tmp/uv_token docker build --network=host -f docker/ci/Dockerfile \ --secret id=uv_token,src=/tmp/uv_token \ -t "${IMAGE}:latest" \ . rm -f /tmp/uv_token - name: Tag and push CI image run: | STAMP="$(date -u +%Y%m%d%H%M)" docker tag "${IMAGE}:latest" "${IMAGE}:${STAMP}" docker push "${IMAGE}:latest" docker push "${IMAGE}:${STAMP}" echo "Pushed ${IMAGE}:latest and ${IMAGE}:${STAMP}"