Files
tubesync/.gitea/workflows/bootstrap-registry-login.yml
wimby 6ed275fda5
Some checks failed
Bootstrap nc-node1 registry login / bootstrap (push) Failing after 26s
ci: bootstrap nc-node1 registry login
2026-09-27 04:38:56 +02:00

42 lines
1.4 KiB
YAML

name: Bootstrap nc-node1 registry login
on:
push:
branches:
- bootstrap-registry-login
jobs:
bootstrap:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Install Docker client
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends docker.io
rm -rf /var/lib/apt/lists/*
- name: Configure nc-node1 registry login
shell: bash
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
test -n "${REGISTRY_TOKEN}"
printf '%s' "${REGISTRY_TOKEN}" | docker run --rm -i --network host \
-v /home/ubuntu/.ssh:/root/host-ssh:ro \
alpine:3.22 sh -ceu '
cat > /tmp/registry-token
apk add --no-cache openssh-client >/dev/null
install -m 600 /root/host-ssh/nc-node1 /tmp/nc-node1
install -m 600 /root/host-ssh/known_hosts /tmp/known_hosts
ssh -i /tmp/nc-node1 \
-o BatchMode=yes \
-o UserKnownHostsFile=/tmp/known_hosts \
-o StrictHostKeyChecking=yes \
user@192.168.1.21 \
"docker login git.wimby.cz --username wimby --password-stdin" \
< /tmp/registry-token
rm -f /tmp/registry-token
'