This commit is contained in:
1 parent
b92b29980c
commit
28438dcde6
1 file changed
+5
-2
@@ -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" \
|
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
|
| 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
|
- name: Build & push image to Gitea Packages
|
||||||
run: |
|
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 build -t "$IMAGE:${{ steps.tag.outputs.sha }}" -t "$IMAGE:latest" .
|
||||||
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
|
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
|
||||||
docker push "$IMAGE:latest"
|
docker push "$IMAGE:latest"
|
||||||
@@ -81,5 +84,5 @@ jobs:
|
|||||||
git add k8s/kustomization.yaml
|
git add k8s/kustomization.yaml
|
||||||
git diff --cached --quiet && { echo "no image change"; exit 0; }
|
git diff --cached --quiet && { echo "no image change"; exit 0; }
|
||||||
git commit -m "ci: deploy ${{ steps.tag.outputs.sha }} [skip ci]"
|
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
|
git push origin HEAD:main
|
||||||
Reference in new issue
Block a user