ci: use CI_TOKEN PAT for registry push and tag-bump
Some checks failed
CI / ci (push) Failing after 20m4s

This commit is contained in:
Brad Rodgers 2026-07-16 16:02:00 -04:00
parent b92b29980c
commit 28438dcde6

View File

@ -66,9 +66,12 @@ jobs:
curl -sSL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz" \
| tar xz -C /usr/local/bin
# CI_TOKEN: a Gitea Personal Access Token (scopes: write:package, write:repository) owned by
# the repo owner, stored as a repo Actions secret. The auto GITEA_TOKEN lacks reliable package
# scope on Gitea, hence a dedicated PAT for both the registry push and the tag-bump commit.
- name: Build & push image to Gitea Packages
run: |
echo "${{ secrets.GITEA_TOKEN }}" | docker login 10.66.15.22:3000 -u "${{ github.actor }}" --password-stdin
echo "${{ secrets.CI_TOKEN }}" | docker login 10.66.15.22:3000 -u "${{ github.repository_owner }}" --password-stdin
docker build -t "$IMAGE:${{ steps.tag.outputs.sha }}" -t "$IMAGE:latest" .
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
docker push "$IMAGE:latest"
@ -81,5 +84,5 @@ jobs:
git add k8s/kustomization.yaml
git diff --cached --quiet && { echo "no image change"; exit 0; }
git commit -m "ci: deploy ${{ steps.tag.outputs.sha }} [skip ci]"
git remote set-url origin "http://gitea-actions:${{ secrets.GITEA_TOKEN }}@10.66.15.22:3000/bmr_bluecap/bcs-website.git"
git remote set-url origin "http://${{ github.repository_owner }}:${{ secrets.CI_TOKEN }}@10.66.15.22:3000/bmr_bluecap/bcs-website.git"
git push origin HEAD:main