Run-releases/r8.0-22 #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bitween API CI/CD (Gateway · both) | |
| run-name: Run-${{ github.ref_name }}-${{ github.run_number }} | |
| on: | |
| push: | |
| branches: | |
| - releases/** | |
| workflow_dispatch: | |
| concurrency: | |
| group: cicd-gateway-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| # contents: write -> tag job. packages: write -> publish AND pull the Helm chart | |
| # via GHCR OCI ('both' also pushes it to ChartMuseum). The Docker image and the | |
| # SDK NuGet package go to Docker Hub / the NuGet feed respectively. | |
| permissions: | |
| contents: write | |
| packages: write | |
| security-events: read | |
| jobs: | |
| build-publish-deploy: | |
| # Mirrors the old deploy-release gate: only the r8.0 release line (or manual). | |
| if: ${{ (github.event_name == 'push' && github.ref_name == 'releases/r8.0') || github.event_name == 'workflow_dispatch' }} | |
| uses: simplify9/.github/.github/workflows/reusable-service-cicd.yml@main | |
| with: | |
| major-version: '8' | |
| minor-version: '1' | |
| dotnet-version: '8.0.x' | |
| dockerfile-path: './Dockerfile' | |
| docker-context: '.' | |
| docker-platforms: 'linux/amd64' | |
| chart-name: 'bitween' # must match charts/default Chart.yaml name: | |
| chart-path: './charts/default' | |
| # 1) Publish the Helm chart to BOTH GHCR OCI and ChartMuseum | |
| chart-publish-method: 'both' | |
| chart-repo-url: 'https://charts.sf9.io' | |
| # Docker image stays on Docker Hub | |
| container-registry: 'docker.io' | |
| image-name: 'simplify9/bitween' | |
| # Build + unit-test + push the SDK NuGet package (versioned with the | |
| # pipeline semver, e.g. 8.1.x — was 8.0.<run_number> in the old job). | |
| nuget-projects: 'SW.Bitween.Sdk/SW.Bitween.Sdk.csproj' | |
| run-tests: 'true' | |
| test-projects: 'SW.Bitween.UnitTests/SW.Bitween.UnitTests.csproj' | |
| # 2) Deploy to playground via Gateway API | |
| deploy: true | |
| # 3) Pull the chart from GHCR OCI (the default source for 'both') | |
| deploy-chart-source: 'github-oci' | |
| deploy-namespace: 'playground' | |
| routing-mode: 'gateway-api' | |
| gateway-hostnames: 'app-dev.bitween.io' | |
| gateway-paths: '/api,/swagger' # adapted from the old ingress paths | |
| # app-dev.bitween.io is not *.sf9.io, so the deploy auto-onboards a | |
| # dedicated listener + cert-manager Certificate on the parent gateway | |
| # (public-gateway · s9-dev-edge · cilium · letsencrypt-production-gateway). | |
| # Non-routing chart values (routing itself is generated by gateway-api mode). | |
| helm-set-values: 'global.environment=Development' | |
| secrets: | |
| # Docker image push credentials (Docker Hub) | |
| registry-username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| registry-password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # ChartMuseum credentials (required because chart-publish-method is 'both') | |
| chartmuseum-username: ${{ secrets.CM_USER }} | |
| chartmuseum-password: ${{ secrets.CM_PASSWORD }} | |
| # GHCR chart push + pull and git tagging use the built-in token | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| # NuGet API key for the SDK package push (publishes to nuget.org, the | |
| # reusable's default feed — no nuget-source override needed). | |
| nuget-api-key: ${{ secrets.SWNUGETKEY }} | |
| # Gateway-API cluster kubeconfig (V2) | |
| kubeconfig-gateway: ${{ secrets.S9DEV_KUBECONFIG_V2 }} | |
| dependabot-alerts-token: ${{ secrets.DEPENDABOT_ALERTS_TOKEN }} | |
| # App configuration passed to helm --set-string during deploy (masked) | |
| helm-set-secret-values: 'db=${{ secrets.dbConnection }},global.bus.rabbitUrl=${{ secrets.rabbitUrl }},global.cloudFiles.secretAccessKey=${{ secrets.SecretAccessKey }},global.cloudFiles.accessKeyId=${{ secrets.AccessKeyId }},global.cloudFiles.serviceUrl=${{ secrets.ServiceUrl }},global.cloudFiles.bucketName=${{ secrets.BucketName }},environmentVariables.Bitween__RabbitMqManagementUrl=${{ secrets.RabbitMqManagementUrl }},environmentVariables.Bitween__RabbitMqManagementPassword=${{ secrets.RabbitMqManagementPassword }},environmentVariables.Bitween__RabbitMqManagementUsername=${{ secrets.RabbitMqManagementUsername }}' |