Skip to content

Production Release CI/CD #27

Production Release CI/CD

Production Release CI/CD #27

Workflow file for this run

name: Production Release CI/CD
on:
workflow_dispatch:
inputs:
deploy-service:
description: "Name of the service to deploy"
required: true
type: string
deploy-tag:
description: "Tag for deployment"
required: true
type: string
jobs:
pre-release:
runs-on: ubuntu-latest
outputs:
packages_deployment: ${{ steps.generate-deployment.outputs.PACKAGES_DEPLOYMENT }}
steps:
- name: generate production deployment manifest
id: generate-deployment
run: |
packages_deployment=$(echo '["${{ inputs.deploy-service }}"]' | jq -c 'map({name: ., imageTag:"ghcr.io/stamford-syntax-club/course-compose/\(.):prod-${{ inputs.deploy-tag }}"})')
echo "PACKAGES_DEPLOYMENT=$packages_deployment" >> $GITHUB_OUTPUT
echo "PACKAGES_DEPLOYMENT=$packages_deployment"
deploy-ghcr:
needs: pre-release
if: ${{ needs.pre-release.outputs.packages_deployment != '[]' }}
uses: ./.github/workflows/deploy-ghcr.yaml
with:
packages_deployment: ${{ needs.pre-release.outputs.packages_deployment }}
environment: production
gitops-prod:
needs: [pre-release, deploy-ghcr]
if: ${{ needs.pre-release.outputs.packages_deployment != '[]' }}
uses: ./.github/workflows/gitops.yaml
with:
packages_deployment: ${{ needs.pre-release.outputs.packages_deployment }}
environment: production
secrets:
workflow_token: ${{ secrets.WORKFLOW_TOKEN }}