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:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -44,13 +50,13 @@ jobs:
|
|||||||
printf 'ref=%s/%s:%s\n' "$server" "$repo" "${{ matrix.image }}" >>"$GITHUB_OUTPUT"
|
printf 'ref=%s/%s:%s\n' "$server" "$repo" "${{ matrix.image }}" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Log in to the Gitea container registry
|
- 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
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
printf '%s' "${{ github.token }}" |
|
printf '%s' "$REGISTRY_TOKEN" |
|
||||||
docker login "${{ steps.image.outputs.registry }}" \
|
docker login "${{ steps.image.outputs.registry }}" \
|
||||||
-u "${{ github.actor }}" --password-stdin
|
-u "$REGISTRY_USER" --password-stdin
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -70,7 +76,7 @@ jobs:
|
|||||||
xvfb-run -a env VK_DRIVER_FILES="$icd" vulkaninfo --summary'
|
xvfb-run -a env VK_DRIVER_FILES="$icd" vulkaninfo --summary'
|
||||||
|
|
||||||
- name: Push
|
- name: Push
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && env.REGISTRY_TOKEN != ''
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
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
|
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
|
## Adding an image
|
||||||
|
|
||||||
1. Add `images/<name>/Dockerfile`.
|
1. Add `images/<name>/Dockerfile`.
|
||||||
|
|||||||
Reference in new issue
Block a user