Publish images with the organization registry token
This commit is contained in:
1 parent
5dcc5f3fa0
commit
72bac2d644
2 files changed
+18
-4
No files matched your search
@@ -21,6 +21,12 @@ permissions:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
# The Actions token is not accepted by the container registry, so the push
|
||||
# uses a PAT. REGISTRY_USER / REGISTRY_TOKEN (a repository variable and
|
||||
# secret) override the organization release-bot defaults.
|
||||
env:
|
||||
REGISTRY_USER: ${{ vars.REGISTRY_USER || 'echoion-release-bot' }}
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN || secrets.RELEASE_BOT_TOKEN }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -44,13 +50,13 @@ jobs:
|
||||
printf 'ref=%s/%s:%s\n' "$server" "$repo" "${{ matrix.image }}" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Log in to the Gitea container registry
|
||||
if: github.event_name != 'pull_request'
|
||||
if: github.event_name != 'pull_request' && env.REGISTRY_TOKEN != ''
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
printf '%s' "${{ github.token }}" |
|
||||
printf '%s' "$REGISTRY_TOKEN" |
|
||||
docker login "${{ steps.image.outputs.registry }}" \
|
||||
-u "${{ github.actor }}" --password-stdin
|
||||
-u "$REGISTRY_USER" --password-stdin
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
@@ -70,7 +76,7 @@ jobs:
|
||||
xvfb-run -a env VK_DRIVER_FILES="$icd" vulkaninfo --summary'
|
||||
|
||||
- name: Push
|
||||
if: github.event_name != 'pull_request'
|
||||
if: github.event_name != 'pull_request' && env.REGISTRY_TOKEN != ''
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@@ -59,6 +59,14 @@ GPU). Without a GPU, request the software driver explicitly:
|
||||
VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json vulkaninfo --summary
|
||||
```
|
||||
|
||||
## Publishing
|
||||
|
||||
A push to `main` builds every image and pushes it to the registry. The
|
||||
container registry does not accept the Actions job token, so the workflow logs
|
||||
in with the organization `RELEASE_BOT_TOKEN` as `echoion-release-bot`. Set the
|
||||
repository variable `REGISTRY_USER` and secret `REGISTRY_TOKEN` to use a
|
||||
dedicated account instead.
|
||||
|
||||
## Adding an image
|
||||
|
||||
1. Add `images/<name>/Dockerfile`.
|
||||
|
||||
Reference in new issue
Block a user