when: branch: [main, high-performance] event: push concurrency: limit: 4 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: build-and-push image: woodpeckerci/plugin-kaniko:2.1.1 settings: registry: from_secret: REGISTRY_HOSTPORT repo: nxtgauge-rust-${SERVICE} dockerfile: Dockerfile.simple build_args: - SERVICE_NAME=${SERVICE} tags: - ${CI_COMMIT_SHA} - latest - high-performance-latest username: from_secret: REGISTRY_USERNAME password: from_secret: REGISTRY_PASSWORD insecure: true insecure_pull: true skip_tls_verify: true platforms: linux/amd64 cache: false - name: update-gitops image: alpine/git:latest environment: GHCR_TOKEN: from_secret: GHCR_TOKEN GHCR_USERNAME: from_secret: GHCR_USERNAME commands: - | set -e echo "Updating GitOps for ${SERVICE}" git clone https://${GHCR_USERNAME}:${GHCR_TOKEN}@github.com/Traceworks2023/nxtgauge-gitops.git /tmp/gitops cd /tmp/gitops git checkout main BACKEND_OVERLAY="apps/nxtgauge-backend-rust/overlays/prod" if [ -f "${BACKEND_OVERLAY}/kustomization.yaml" ]; then sed -i "s|image: registry.nxtgauge.com:5000/nxtgauge-rust-${SERVICE}:.*|image: registry.nxtgauge.com:5000/nxtgauge-rust-${SERVICE}:${CI_COMMIT_SHA}|" \ ${BACKEND_OVERLAY}/kustomization.yaml echo "Updated ${SERVICE} in ${BACKEND_OVERLAY}/kustomization.yaml" fi if ! git diff --quiet; then git config user.name "Woodpecker CI" git config user.email "woodpecker@nxtgauge.com" git add -A git commit -m "ci: update ${SERVICE} to ${CI_COMMIT_SHA:0:8}" git push origin main echo "Pushed GitOps update" else echo "No changes to push" fi when: status: success --- when: branch: [main, high-performance] event: push steps: - name: build-and-push-migrate image: woodpeckerci/plugin-kaniko:2.1.1 settings: registry: from_secret: REGISTRY_HOSTPORT repo: nxtgauge-db-migrate dockerfile: Dockerfile.migrate context: . tags: - ${CI_COMMIT_SHA} - latest - high-performance-latest username: from_secret: REGISTRY_USERNAME password: from_secret: REGISTRY_PASSWORD insecure: true insecure_pull: true skip_tls_verify: true platforms: linux/amd64 cache: false