fix(ci): switch from GHCR to Forgejo registry

- Update workflow to push to ci.nxtgauge.com/ashwin/*
- Use FORGEJO_USERNAME and FORGEJO_TOKEN secrets
- Fix gitops repo cloning to use x-access-token
- Add ai-assistant to deployment scripts
This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-06 03:49:11 +05:30
parent cba7f607cd
commit 76e8646c7c

View file

@ -1,4 +1,4 @@
name: build-and-deploy-ghcr
name: build-and-deploy-forgejo
on:
push:
@ -14,6 +14,8 @@ permissions:
env:
K8S_NAMESPACE: nxtgauge
GITOPS_REPO: Traceworks2023/nxtgauge-gitops
REGISTRY: ci.nxtgauge.com
REGISTRY_USER: ashwin
jobs:
build-deploy:
@ -52,12 +54,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
- name: Login to Forgejo Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
registry: ci.nxtgauge.com
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Build and push image
id: build
@ -69,7 +71,7 @@ jobs:
platforms: linux/amd64
build-args: |
SERVICE_NAME=${{ matrix.service }}
tags: ghcr.io/traceworks2023/nxtgauge-rust-${{ matrix.service }}:${{ github.sha }}
tags: ci.nxtgauge.com/ashwin/nxtgauge-rust-${{ matrix.service }}:${{ github.sha }}
- name: Sync GitOps release
env:
@ -77,8 +79,8 @@ jobs:
run: |
set -euo pipefail
workdir="$(mktemp -d /tmp/nxtgauge-gitops.XXXXXX)"
trap 'rm -rf "$workdir"' EXIT
git clone "https://${{ secrets.GHCR_USERNAME }}:${GITOPS_TOKEN}@github.com/${GITOPS_REPO}.git" "$workdir"
trap 'rm -rf \"$workdir\"' EXIT
git clone "https://x-access-token:${GITOPS_TOKEN}@github.com/${GITOPS_REPO}.git" "$workdir"
cd "$workdir"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"