Skip to content

Commit

Permalink
Update PR build workflow (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsams authored Nov 7, 2024
1 parent ba13326 commit 7b24af5
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,34 @@ on:
workflow_dispatch:

jobs:
prepare-test:
name: 'Prepare Test Run'
runs-on: ubuntu-latest
outputs:
DEPLOYMENTNAME: ${{ steps.make-name.outputs.DEPLOYMENTNAME }}
steps:
- name: Compose deployment name
uses: azure/powershell@v2
id: make-name
with:
azPSVersion: "latest"
inlineScript: |
if($env:GITHUB_EVENT_NAME -eq "pull_request") {
$deploymentName = "ctpr${{ github.event.number }}"
}
else {
$sha = $env:GITHUB_SHA.Substring(0, 4)
$deploymentName = "ct$sha"
}
echo "DEPLOYMENTNAME=$deploymentName" >> $env:GITHUB_OUTPUT
run-build-deploy:
name: 'Run Build and Deploy pipeline'
uses: ./.github/workflows/build-deploy.yml
needs: [prepare-test]
with:
DEPLOYMENT_NAME: 'ctcpr${{ github.event.number }}'
DEPLOYMENT_NAME: '${{ needs.prepare-test.outputs.DEPLOYMENTNAME }}'
secrets: inherit

delete-resources:
Expand Down

0 comments on commit 7b24af5

Please sign in to comment.