Compare commits

...
Author SHA1 Message Date
dzu
de8fe6333b refer to correct image for my CI 2026-02-05 20:32:14 +00:00
dzu
f037e1ac6c use _actually good_ bash arguments 2026-02-05 20:14:43 +00:00
dzu
bddb9fea09 fix "cannot log in on a non-tty device" error 2026-02-05 19:56:34 +00:00
dzu
76e2acd9de set good bash options 2026-02-05 19:51:03 +00:00
dzu
a6a481a269 fix printenv usage 2026-02-05 19:47:51 +00:00
dzu
876b42e2ef fix fallback image name 2026-02-05 19:45:35 +00:00
2 changed files with 4 additions and 3 deletions

View file

@ -2,7 +2,7 @@
Works, as long as there is access to `docker` CLI.
In my workflows, it is being run in the `alpine` linux with `git`, `bash` and `docker-cli` packages installed (see [actions/alpine](https://git.dzuchun.ing/actions/alpine)). Official `docker:cli` image should work too.
In my workflows, it is being run in the `alpine` linux with `git`, `bash` and `docker-cli` packages installed (see [actions/docker](https://git.dzuchun.ing/actions/docker)). Official `docker:cli` image should work too.
## License

View file

@ -1,10 +1,11 @@
#!/bin/bash
set -eu -o pipefail
REGISTRY_URL=$(printenv INPUT_REGISTRY-URL)
USER=$(printenv INPUT_REGISTRY-USER)
IMAGE=$(printenv INPUT_IMAGE-NAME)
# fallback to registry variable
IMAGE=${IMAGE:-$FORGEJO_REGISTRY}
IMAGE=${IMAGE:-$FORGEJO_REPOSITORY}
TAG="$INPUT_TAG"
TOKEN="$INPUT_TOKEN"
CONTEXT="$GITHUB_WORKSPACE/$INPUT_CONTEXT"
@ -22,7 +23,7 @@ echo "Building the image, tag=$IMAGE_TAG"
docker build --compress --tag $IMAGE_TAG $CONTEXT
# log in the registry
printenv $TOKEN | docker login -u $USER --password-stdin $REGISTRY_URL
echo $TOKEN | docker login -u $USER --password-stdin $REGISTRY_URL
# push the image
docker push $IMAGE_TAG