33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
when:
|
|
- event: push
|
|
branch: main
|
|
|
|
depends_on:
|
|
- test
|
|
|
|
steps:
|
|
- name: build-image
|
|
image: gcr.io/kaniko-project/executor:v1.23.2-debug
|
|
environment:
|
|
GITEA_TOKEN:
|
|
from_secret: registry_token
|
|
commands:
|
|
- mkdir -p /kaniko/.docker
|
|
- REGISTRY=$${CI_FORGE_URL#*://}
|
|
# Registry paths are lowercase; the repository is konairius/Wiki.
|
|
- IMAGE=$(printf '%s/%s' "$$REGISTRY" "$$CI_REPO" | tr 'A-Z' 'a-z')
|
|
# The repo owner is an organisation; the registry login is the bot in its Bots team.
|
|
- AUTH=$(printf "%s" "claude-bot:$GITEA_TOKEN" | base64 -w0)
|
|
- printf '{"auths":{"%s":{"auth":"%s"}}}' "$$REGISTRY" "$AUTH" > /kaniko/.docker/config.json
|
|
- BUILD_TAG="build.$(date +%s)"
|
|
- >-
|
|
/kaniko/executor
|
|
--context=.
|
|
--dockerfile=Dockerfile
|
|
--destination=$$IMAGE:${CI_COMMIT_SHA}
|
|
--destination=$$IMAGE:${CI_COMMIT_SHA:0:7}
|
|
--destination=$$IMAGE:$${BUILD_TAG}
|
|
--destination=$$IMAGE:main
|
|
--snapshot-mode=redo
|
|
--use-new-run
|