1 parent
ea1f310b1f
commit
1f8f94977c
2 files changed
+20
-18
No files matched your search
+11
-11
@@ -20,7 +20,7 @@ env:
|
||||
ANDROID_NDK_VERSION: "27.2.12479018"
|
||||
# Bump the rN suffix whenever the Dockerfile toolchain must be rebuilt.
|
||||
REGISTRY: "registry.brunner.ninja"
|
||||
BUILD_IMAGE: "registry.brunner.ninja/feedc0de/evcharger-ci:qt-6.11.1-r1"
|
||||
BUILD_IMAGE: "registry.brunner.ninja/feedc0de/evcharger-app:qt-6.11.1-r1"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -57,19 +57,19 @@ jobs:
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
set -Eeuo pipefail
|
||||
: "${REGISTRY_USERNAME:?REGISTRY_USERNAME secret is required to access the toolchain image}"
|
||||
: "${REGISTRY_PASSWORD:?REGISTRY_PASSWORD secret is required to access the toolchain image}"
|
||||
|
||||
auth_file="${RUNNER_TEMP:-/tmp}/evcharger-registry-auth-${GITHUB_RUN_ID}.json"
|
||||
export REGISTRY_AUTH_FILE="$auth_file"
|
||||
trap 'rm -f -- "$auth_file"' EXIT
|
||||
printf '%s' "$REGISTRY_PASSWORD" | podman login "$REGISTRY" \
|
||||
--username "$REGISTRY_USERNAME" \
|
||||
--password-stdin
|
||||
|
||||
if podman pull "$BUILD_IMAGE"; then
|
||||
echo "Using published toolchain image: $BUILD_IMAGE"
|
||||
else
|
||||
: "${REGISTRY_USERNAME:?REGISTRY_USERNAME secret is required to publish a new toolchain image}"
|
||||
: "${REGISTRY_PASSWORD:?REGISTRY_PASSWORD secret is required to publish a new toolchain image}"
|
||||
|
||||
auth_file="${RUNNER_TEMP:-/tmp}/evcharger-registry-auth-${GITHUB_RUN_ID}.json"
|
||||
export REGISTRY_AUTH_FILE="$auth_file"
|
||||
trap 'rm -f -- "$auth_file"' EXIT
|
||||
printf '%s' "$REGISTRY_PASSWORD" | podman login "$REGISTRY" \
|
||||
--username "$REGISTRY_USERNAME" \
|
||||
--password-stdin
|
||||
|
||||
echo "Toolchain image is not published yet; building $BUILD_IMAGE"
|
||||
podman build --pull=always \
|
||||
--layers \
|
||||
|
||||
@@ -60,18 +60,20 @@ caches stored by Gitea Actions.
|
||||
|
||||
## Toolchain registry credentials
|
||||
|
||||
Runners pull the public image anonymously. Publishing a new toolchain revision
|
||||
uses the existing credentials for `registry.brunner.ninja`. Add these repository
|
||||
secrets under **Settings > Actions > Secrets**:
|
||||
The registry is backed by Quay. Use a Quay robot account with write access to
|
||||
the `feedc0de/evcharger-app` repository; this avoids tying CI to a person's
|
||||
account. Add its credentials as repository secrets under
|
||||
**Settings > Actions > Secrets**:
|
||||
|
||||
| Secret | Value |
|
||||
| --- | --- |
|
||||
| `REGISTRY_USERNAME` | Registry account allowed to push `feedc0de/evcharger-ci` |
|
||||
| `REGISTRY_PASSWORD` | Password or token for that registry account |
|
||||
| `REGISTRY_USERNAME` | Quay robot username, including its namespace prefix |
|
||||
| `REGISTRY_PASSWORD` | Quay robot token |
|
||||
|
||||
The image is published as
|
||||
`registry.brunner.ninja/feedc0de/evcharger-ci:qt-6.11.1-r1`. Runners only use
|
||||
the credentials when the tag does not exist and must be built and pushed.
|
||||
`registry.brunner.ninja/feedc0de/evcharger-app:qt-6.11.1-r1`. The workflow logs
|
||||
in before pulling because this repository is not anonymously readable. The
|
||||
robot needs write permission so the first run of a new revision can push it.
|
||||
Credentials are written to a per-job temporary authentication file and removed
|
||||
before the step exits.
|
||||
|
||||
|
||||
Reference in new issue
Block a user