diff --git a/.forgejo/workflows/build-base.yaml b/.forgejo/workflows/build-base.yaml index f7d39d4e..f66ab4d8 100644 --- a/.forgejo/workflows/build-base.yaml +++ b/.forgejo/workflows/build-base.yaml @@ -22,9 +22,14 @@ on: - cron: '0 6 * * 0' workflow_dispatch: +# Base image lives on Codeberg's container registry. The shared +# REGISTRY_USER / REGISTRY_PASSWORD secrets are set to Codeberg +# credentials; the registry URL is hardcoded here rather than read +# from secrets.REGISTRY_URL so the workflow can't accidentally push +# to a different registry if that secret drifts. env: - REGISTRY: git.mcintire.me - IMAGE_NAME: graham/prop-base + REGISTRY: codeberg.org + IMAGE_NAME: gmcintire/prop-base concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -90,13 +95,19 @@ jobs: TAG="wgrib2-${WGRIB2}-g2c-${G2C}-${TIMESTAMP}" echo "tag=${TAG}" >> $GITHUB_OUTPUT - - name: Log in to container registry + - name: Log in to Codeberg container registry run: | + # Reuses the shared REGISTRY_USER / REGISTRY_PASSWORD + # Forgejo Actions secrets — already set with Codeberg + # credentials (token must have `write:package` scope). + # Login URL is the hardcoded env.REGISTRY rather than + # secrets.REGISTRY_URL so this workflow can't accidentally + # push to whatever registry the URL secret points at. attempt=1 max_attempts=3 while : ; do if echo "${{ secrets.REGISTRY_PASSWORD }}" | \ - docker login "${{ secrets.REGISTRY_URL }}" \ + docker login "${{ env.REGISTRY }}" \ -u "${{ secrets.REGISTRY_USER }}" \ --password-stdin; then exit 0 diff --git a/Dockerfile b/Dockerfile index 2455c528..d873c19d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ # This file is based on these images: # # - https://hub.docker.com/r/hexpm/elixir/tags - for the build image -# - git.mcintire.me/graham/prop-base - prebuilt runtime base (see Dockerfile.base) +# - codeberg.org/gmcintire/prop-base - prebuilt runtime base (see Dockerfile.base) # - Ex: docker.io/hexpm/elixir:1.19.5-erlang-28.4.1-debian-trixie-20260316-slim # ARG ELIXIR_VERSION=1.19.5 @@ -21,7 +21,7 @@ ARG BUILDER_IMAGE="docker.io/hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION # only when Dockerfile.base changes, so this Dockerfile pulls a # ready-made layer instead of recompiling wgrib2 + reinstalling cdo # (~10 min) on every push. -ARG BASE_IMAGE="git.mcintire.me/graham/prop-base:latest" +ARG BASE_IMAGE="codeberg.org/gmcintire/prop-base:latest" # ---- Elixir build stage ---- FROM ${BUILDER_IMAGE} AS builder