Skip to content

Commit

Permalink
ci: fix feature branch deployment pipeline (#292)
Browse files Browse the repository at this point in the history
## Description:
- resolve nested templates to prevent empty variables
- add code comments
  • Loading branch information
karlbaumhauer authored Jul 28, 2023
1 parent f62ed36 commit 6201765
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .azuredevops/pipelines/deploy-to-cdn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,17 @@ steps:
- bash: |
echo "$(branch)"
displayName: 'Log normalized branch name'
## Push to CDN feature branch folder
- template: templates/push-to-storage-feature.template.yml
## Purge CDN for branch folder
- template: purge-feature-cdn.template.yml

- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
## Push to CDN version folders
- template: templates/push-to-storage-main.template.yml
## Purge CDN for all version folders
- template: purge-main-cdn.template.yml

## If deployment variable is set to 'none' do nothing
- script: |
if [[ $(deployment) == "code" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
# Deploy to version folder
# Deploy to branch folder
set -x
echo "Target folder is $(branch)"
az storage blob upload-batch \
Expand All @@ -17,6 +17,3 @@ steps:
--destination-path "/$(branch)" \
--overwrite
set +x
## Purge CDN for branch folder
- template: purge-feature-cdn.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,3 @@ steps:
else
echo "Deployment type is 'none', therefore nothing to deploy."
fi
## Purge CDN for all folders
- template: purge-main-cdn.template.yml

0 comments on commit 6201765

Please sign in to comment.