This commit is contained in:
@@ -11,6 +11,8 @@ on:
|
||||
env:
|
||||
REGISTRY_HOST: git.neosisyphus.com
|
||||
REGISTRY_IMAGE: git.neosisyphus.com/evol3d/evol-testbed
|
||||
# Optional. If this secret is not set, the workflow uses GITHUB_ACTOR.
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
|
||||
jobs:
|
||||
image:
|
||||
@@ -21,8 +23,18 @@ jobs:
|
||||
|
||||
- name: Log in to container registry
|
||||
run: |
|
||||
set -eu
|
||||
username="${REGISTRY_USERNAME:-${GITHUB_ACTOR:-}}"
|
||||
if [ -z "$username" ]; then
|
||||
echo "REGISTRY_USERNAME secret is empty and GITHUB_ACTOR is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${{ secrets.REGISTRY_PASSWORD }}" ]; then
|
||||
echo "REGISTRY_PASSWORD secret is empty. Set it to a Gitea access token with package write permission." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "$REGISTRY_HOST" \
|
||||
-u "${{ secrets.REGISTRY_USERNAME }}" \
|
||||
-u "$username" \
|
||||
--password-stdin
|
||||
|
||||
- name: Build CI image
|
||||
|
||||
+9
-2
@@ -35,15 +35,22 @@ REGISTRY_IMAGE=git.neosisyphus.com/evol3d/evol-testbed
|
||||
CI_IMAGE=git.neosisyphus.com/evol3d/evol-testbed
|
||||
```
|
||||
|
||||
Add these **Actions secrets**:
|
||||
Add this **Actions secret**:
|
||||
|
||||
```text
|
||||
REGISTRY_USERNAME=your-gitea-username
|
||||
REGISTRY_PASSWORD=your-gitea-token-or-password
|
||||
```
|
||||
|
||||
The token/password needs permission to publish packages/container images.
|
||||
|
||||
Optional: add this secret if your registry username is different from the Gitea Actions actor:
|
||||
|
||||
```text
|
||||
REGISTRY_USERNAME=your-gitea-username
|
||||
```
|
||||
|
||||
If `REGISTRY_USERNAME` is not set, the workflow uses `$GITHUB_ACTOR`.
|
||||
|
||||
## Build manually
|
||||
|
||||
```bash
|
||||
|
||||
+11
-10
@@ -169,24 +169,28 @@ In your repository:
|
||||
1. Go to **Settings**.
|
||||
2. Go to **Actions**.
|
||||
3. Go to **Secrets**.
|
||||
4. Add:
|
||||
4. Add this required secret:
|
||||
|
||||
```text
|
||||
REGISTRY_USERNAME
|
||||
REGISTRY_PASSWORD
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```text
|
||||
REGISTRY_USERNAME=myusername
|
||||
REGISTRY_PASSWORD=<your-gitea-access-token>
|
||||
```
|
||||
|
||||
Use your Gitea username for `REGISTRY_USERNAME`.
|
||||
|
||||
Use the token from step 3 for `REGISTRY_PASSWORD`.
|
||||
|
||||
Optional: add this secret if your registry username is different from the Gitea Actions actor:
|
||||
|
||||
```text
|
||||
REGISTRY_USERNAME=myusername
|
||||
```
|
||||
|
||||
If `REGISTRY_USERNAME` is not set, the workflow uses `$GITHUB_ACTOR`.
|
||||
|
||||
---
|
||||
|
||||
## 6. Check the image build workflow
|
||||
@@ -592,13 +596,10 @@ This avoids surprise breakage when `clang22` or `latest` changes.
|
||||
```text
|
||||
1. Commit ci/Dockerfile and workflows.
|
||||
2. Create Gitea token with package/container write access.
|
||||
3. Add Actions variables:
|
||||
- REGISTRY_HOST
|
||||
- REGISTRY_IMAGE
|
||||
- CI_IMAGE
|
||||
3. Registry/image values are already hardcoded in the workflow.
|
||||
4. Add Actions secrets:
|
||||
- REGISTRY_USERNAME
|
||||
- REGISTRY_PASSWORD
|
||||
- REGISTRY_USERNAME only if needed
|
||||
5. Make sure the runner can run docker build.
|
||||
6. Run build-ci-image workflow.
|
||||
7. Confirm image appears in Gitea Packages.
|
||||
|
||||
Reference in New Issue
Block a user