Skip to content

Revert "merge: auth password rotation and QR code UI" #3

Revert "merge: auth password rotation and QR code UI"

Revert "merge: auth password rotation and QR code UI" #3

Workflow file for this run

name: Staging CI/CD Pipeline
on:
push:
branches: ["main", "develop", "staging", "master"]
pull_request:
jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "20"
cache: "npm"
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test:ci
deploy-staging:
name: Continuous Deployment (Staging)
needs: ci
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
runs-on: ubuntu-latest
environment:
name: staging
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/${{ github.repository_owner }}/socialflow-backend
TAG: ${{ github.sha }}
steps:
- uses: actions/checkout@v7
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
file: backend/Dockerfile
push: true
tags: |
${{ env.IMAGE }}:${{ env.TAG }}
${{ env.IMAGE }}:latest
- name: Set up kubectl
uses: azure/setup-kubectl@v3
- name: Configure kubeconfig
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
chmod 600 ~/.kube/config
- name: Deploy to Kubernetes
run: |
kubectl set image deployment/socialflow-backend \
backend=${{ env.IMAGE }}:${{ env.TAG }} \
--namespace=staging
kubectl rollout status deployment/socialflow-backend \
--namespace=staging \
--timeout=120s
- name: Smoke test /health
run: |
BACKEND_URL="${{ secrets.STAGING_BACKEND_URL }}"
echo "Polling ${BACKEND_URL}/health ..."
timeout 120 bash -c \
'until curl -sf "${BACKEND_URL}/health"; do echo "waiting..."; sleep 5; done'
echo "Health check passed"