on:
  push:
    tags:
      - v*

name: Build and deploy the backend to production

jobs:
  build-and-push:
    name: Build and push image
    uses: ./.gitea/workflows/workflow_build-image.yaml
    with:
      tag: stable
    secrets:
      PACKAGE_REGISTRY_ACCESS: ${{ secrets.PACKAGE_REGISTRY_ACCESS }}
  
  deploy-prod:
    name: Deploy to production
    uses: ./.gitea/workflows/workflow_deploy-container.yaml
    with:
      overlay: prod
    secrets:
      KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
    needs: build-and-push