neiam
/waxx
waxx
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
Push the image to the forge registry as well
51189f3 · Gabriel Morell · 2026-09-13 02:38
Message
{commit_body(@commit)}
Files changed
modified
.github/workflows/ci.yml
+28
−0
@@ -76,8 +76,35 @@ jobs:
| 76 | 76 | - uses: actions/checkout@v4 |
| 77 | 77 | - uses: docker/setup-buildx-action@v3 |
| 78 | 78 | |
| 79 | + # An unset CI_REGISTRY resolves to the empty string, and | |
| 80 | + # login-action then silently defaults to docker.io while | |
| 81 | + # metadata-action builds a nonsense "/owner/repo" reference. Say | |
| 82 | + # what is missing instead. | |
| 83 | + - name: Check the registry variable is set | |
| 84 | + env: | |
| 85 | + CI_REGISTRY: ${{ vars.CI_REGISTRY }} | |
| 86 | + run: | | |
| 87 | + set -euo pipefail | |
| 88 | + if [ -z "${CI_REGISTRY:-}" ]; then | |
| 89 | + echo "CI_REGISTRY is not set for this repository." >&2 | |
| 90 | + echo "Set it as an organisation-level Actions variable (the" >&2 | |
| 91 | + echo "registry hostname), the same one gitgud builds against." >&2 | |
| 92 | + exit 1 | |
| 93 | + fi | |
| 94 | + echo "pushing to $CI_REGISTRY" | |
| 95 | + | |
| 79 | 96 | # GHCR uses the built-in token. Docker Hub and Quay creds come from |
| 80 | 97 | # org-wide secrets (DOCKERHUB_USER/DOCKERHUB_TOKEN, QUAY_USERNAME/QUAY_TOKEN). |
| 98 | + # The forge's own registry: no stored credential, the per-job token | |
| 99 | + # is authorized to push this repository's own image path. | |
| 100 | + - name: Log in to the forge registry | |
| 101 | + if: github.event_name != 'pull_request' | |
| 102 | + uses: docker/login-action@v3 | |
| 103 | + with: | |
| 104 | + registry: ${{ vars.CI_REGISTRY }} | |
| 105 | + username: ci | |
| 106 | + password: ${{ github.token }} | |
| 107 | + | |
| 81 | 108 | - name: Log in to GHCR |
| 82 | 109 | if: github.event_name != 'pull_request' |
| 83 | 110 | uses: docker/login-action@v3 |
@@ -106,6 +133,7 @@ jobs:
| 106 | 133 | uses: docker/metadata-action@v5 |
| 107 | 134 | with: |
| 108 | 135 | images: | |
| 136 | + ${{ vars.CI_REGISTRY }}/${{ github.repository }} | |
| 109 | 137 | ghcr.io/${{ github.repository }} |
| 110 | 138 | docker.io/neiam/waxx |
| 111 | 139 | quay.io/neiam/waxx |
Parents: f6a6e1a