Skip to content

Running pull request flow for fix/concurrency #61

Running pull request flow for fix/concurrency

Running pull request flow for fix/concurrency #61

Workflow file for this run

name: Pull request workflow
run-name: Running pull request flow for ${{ github.head_ref }}
concurrency: pull-request-${{ github.ref_name }}
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, closed]
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
create-subdomain-hash:
name: Create a deterministic subdomain hash based on the branch name
runs-on: ubuntu-latest
outputs:
subdomainHash: ${{ steps.generateHash.outputs.hash }}
steps:
- id: generateHash
run: |
branch_hash=($(sha1sum <<< ${{ github.head_ref }} | rev | cut -c 32- | rev))
echo -n "hash=$branch_hash" >> "$GITHUB_OUTPUT"
apply-infrastructure:
name: Apply infrastructure
uses: ./.github/workflows/reusable-apply-infrastructure.yaml
with:
suffix: ${{ github.head_ref }}
environment: preview
cloudSubDomain: ${{ needs.create-subdomain-hash.outputs.subdomainHash }}.cloud
dotnetSubDomain: ${{ needs.create-subdomain-hash.outputs.subdomainHash }}.dotnet
needs: [create-subdomain-hash]
secrets: inherit
build-cloud-application:
name: Build XPRTZ Cloud application
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-build-application.yaml
with:
application: cloud
needs: [apply-infrastructure]
deploy-cloud-application:
name: Deploy XPRTZ Cloud application
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-deploy-application.yaml
with:
application: cloud
storageAccount: ${{ needs.apply-infrastructure.outputs.cloudStorageAccount }}
resourceGroup: ${{ needs.apply-infrastructure.outputs.resourceGroup }}
environment: preview
needs: [apply-infrastructure, build-cloud-application]
secrets: inherit
build-dotnet-application:
name: Build XPRTZ .NET application
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-build-application.yaml
with:
application: dotnet
needs: [apply-infrastructure]
deploy-dotnet-application:
name: Deploy XPRTZ .NET application
if: github.event.action != 'closed'
uses: ./.github/workflows/reusable-deploy-application.yaml
with:
application: dotnet
storageAccount: ${{ needs.apply-infrastructure.outputs.dotnetStorageAccount }}
resourceGroup: ${{ needs.apply-infrastructure.outputs.resourceGroup }}
environment: preview
needs: [apply-infrastructure, build-dotnet-application]
secrets: inherit
remove-infrastructure:
name: Remove preview environment infrastructure
if: github.event.action == 'closed'
uses: ./.github/workflows/reusable-destroy-infrastructure.yaml
with:
environment: preview
resourcegroup: ${{ needs.apply-infrastructure.outputs.resourceGroup }}
needs: [apply-infrastructure]
secrets: inherit