ci: remove GitHub Actions workflow - using Forgejo CI exclusively
- Remove build-and-deploy-forgejo.yml from GitHub Actions - Forgejo CI at ci.nxtgauge.com now handles all builds and deployments - All images pushed to Forgejo registry (ci.nxtgauge.com/ashwin/*) - GitOps updates handled by Forgejo workflows
This commit is contained in:
parent
b8939e6384
commit
67d372c160
1 changed files with 0 additions and 105 deletions
105
.github/workflows/build-and-deploy-forgejo.yml
vendored
105
.github/workflows/build-and-deploy-forgejo.yml
vendored
|
|
@ -1,105 +0,0 @@
|
||||||
name: build-and-deploy-forgejo
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- high-performance
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
K8S_NAMESPACE: nxtgauge
|
|
||||||
GITOPS_REPO: Traceworks2023/nxtgauge-gitops
|
|
||||||
REGISTRY: ci.nxtgauge.com
|
|
||||||
REGISTRY_USER: ashwin
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-deploy:
|
|
||||||
runs-on: [self-hosted, linux, x64, ubuntu-latest, docker-ready]
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 3
|
|
||||||
matrix:
|
|
||||||
service:
|
|
||||||
- gateway
|
|
||||||
- users
|
|
||||||
- companies
|
|
||||||
- jobs
|
|
||||||
- leads
|
|
||||||
- job-seekers
|
|
||||||
- customers
|
|
||||||
- payments
|
|
||||||
- employees
|
|
||||||
- photographers
|
|
||||||
- makeup-artists
|
|
||||||
- tutors
|
|
||||||
- developers
|
|
||||||
- video-editors
|
|
||||||
- graphic-designers
|
|
||||||
- social-media-managers
|
|
||||||
- fitness-trainers
|
|
||||||
- catering-services
|
|
||||||
- ugc-content-creators
|
|
||||||
- cron
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to Forgejo Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ci.nxtgauge.com
|
|
||||||
username: ${{ secrets.FORGEJO_USERNAME }}
|
|
||||||
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push image
|
|
||||||
id: build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfile.simple
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64
|
|
||||||
build-args: |
|
|
||||||
SERVICE_NAME=${{ matrix.service }}
|
|
||||||
tags: ci.nxtgauge.com/ashwin/nxtgauge-rust-${{ matrix.service }}:${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Sync GitOps release
|
|
||||||
env:
|
|
||||||
GITOPS_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
workdir="$(mktemp -d /tmp/nxtgauge-gitops.XXXXXX)"
|
|
||||||
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"
|
|
||||||
for attempt in 1 2 3 4 5; do
|
|
||||||
git fetch origin main
|
|
||||||
git reset --hard origin/main
|
|
||||||
./scripts/set-backend-rust-release.sh "${{ matrix.service }}" "${{ steps.build.outputs.digest }}"
|
|
||||||
if git diff --quiet; then
|
|
||||||
echo "GitOps repo already up to date."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
git add apps/nxtgauge-backend-rust/overlays/prod/backend-release-state.tsv apps/nxtgauge-backend-rust/overlays/prod/release-patches.yaml apps/nxtgauge-backend-rust/overlays/prod/disabled-deployments.yaml
|
|
||||||
git commit -m "chore(gitops): deploy backend ${{ matrix.service }}@${{ github.sha }}"
|
|
||||||
if git push origin HEAD:main; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "GitOps push race on attempt ${attempt}, retrying..."
|
|
||||||
git reset --hard origin/main
|
|
||||||
sleep $((attempt * 2))
|
|
||||||
done
|
|
||||||
echo "Failed to update GitOps after multiple attempts."
|
|
||||||
exit 1
|
|
||||||
Loading…
Add table
Reference in a new issue