chore(ci): source registry host from secrets.REGISTRY_URL
All three image build workflows previously hardcoded REGISTRY=codeberg.org and only pulled USER/PASSWORD from secrets. Switching the URL to come from the same secrets bag means a registry rotation only needs the REGISTRY_URL / REGISTRY_USER / REGISTRY_PASSWORD secrets updated, not a commit to every workflow file.
This commit is contained in:
parent
18680b35e5
commit
1650744e89
3 changed files with 13 additions and 18 deletions
|
|
@ -22,13 +22,11 @@ on:
|
||||||
- cron: '0 6 * * 0'
|
- cron: '0 6 * * 0'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# Base image lives on Codeberg's container registry. The shared
|
# Base image lives on Codeberg's container registry. Registry host
|
||||||
# REGISTRY_USER / REGISTRY_PASSWORD secrets are set to Codeberg
|
# and creds are sourced from the shared REGISTRY_URL / REGISTRY_USER
|
||||||
# credentials; the registry URL is hardcoded here rather than read
|
# / REGISTRY_PASSWORD secrets.
|
||||||
# from secrets.REGISTRY_URL so the workflow can't accidentally push
|
|
||||||
# to a different registry if that secret drifts.
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: codeberg.org
|
REGISTRY: ${{ secrets.REGISTRY_URL }}
|
||||||
IMAGE_NAME: gmcintire/prop-base
|
IMAGE_NAME: gmcintire/prop-base
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
@ -97,12 +95,9 @@ jobs:
|
||||||
|
|
||||||
- name: Log in to Codeberg container registry
|
- name: Log in to Codeberg container registry
|
||||||
run: |
|
run: |
|
||||||
# Reuses the shared REGISTRY_USER / REGISTRY_PASSWORD
|
# Reuses the shared REGISTRY_URL / REGISTRY_USER /
|
||||||
# Forgejo Actions secrets — already set with Codeberg
|
# REGISTRY_PASSWORD Forgejo Actions secrets (Codeberg
|
||||||
# credentials (token must have `write:package` scope).
|
# 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
|
attempt=1
|
||||||
max_attempts=3
|
max_attempts=3
|
||||||
while : ; do
|
while : ; do
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ on:
|
||||||
|
|
||||||
# Hosted on Codeberg's container registry. Same setup as build.yaml.
|
# Hosted on Codeberg's container registry. Same setup as build.yaml.
|
||||||
env:
|
env:
|
||||||
REGISTRY: codeberg.org
|
REGISTRY: ${{ secrets.REGISTRY_URL }}
|
||||||
IMAGE_NAME: gmcintire/prop-grid-rs
|
IMAGE_NAME: gmcintire/prop-grid-rs
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
# Hosted on Codeberg's container registry. The shared
|
# Hosted on Codeberg's container registry. Registry host + creds
|
||||||
# REGISTRY_USER / REGISTRY_PASSWORD secrets carry the Codeberg
|
# are sourced from the shared REGISTRY_URL / REGISTRY_USER /
|
||||||
# token; URL is hardcoded so a wrong/missing secrets.REGISTRY_URL
|
# REGISTRY_PASSWORD secrets so the registry can be rotated without
|
||||||
# can't push to the wrong registry.
|
# editing every workflow file.
|
||||||
env:
|
env:
|
||||||
REGISTRY: codeberg.org
|
REGISTRY: ${{ secrets.REGISTRY_URL }}
|
||||||
IMAGE_NAME: gmcintire/prop
|
IMAGE_NAME: gmcintire/prop
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue