Skip to content

Commit

Permalink
Merge pull request #33 from IATI/deploy_html_files
Browse files Browse the repository at this point in the history
fix: update website on redeploy
  • Loading branch information
simon-20 authored Jan 16, 2025
2 parents 6bfd8ab + c9a5633 commit 116f171
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build-and-deploy-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ jobs:
echo "TARGET_ENVIRONMENT_UPPER=${TARGET_ENVIRONMENT^^}" >> ${GITHUB_ENV}
echo "CONTAINER_INSTANCE_BASE_NAME=aci-${APP_NAME}" >> ${GITHUB_ENV}
echo "RESOURCE_GROUP_BASE_NAME=rg-${APP_NAME}" >> ${GITHUB_ENV}
echo "APP_NAME_NO_HYPHENS=${APP_NAME//-/}" >> ${GITHUB_ENV}
echo "STORAGE_ACCOUNT_NAME=sa${APP_NAME_NO_HYPHENS}$TARGET_ENVIRONMENT" >> ${GITHUB_ENV}
- name: 'Print calculated environment variables'
run: |
echo $TARGET_ENVIRONMENT_UPPER
echo $CONTAINER_INSTANCE_BASE_NAME
echo $RESOURCE_GROUP_BASE_NAME
echo $APP_NAME_NO_HYPHENS
echo $STORAGE_ACCOUNT_NAME
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
Expand Down Expand Up @@ -125,3 +129,16 @@ jobs:
az container create --debug \
--resource-group "${{ env.RESOURCE_GROUP_BASE_NAME }}-${{ env.TARGET_ENVIRONMENT }}" \
--file ./azure-deployment/azure-resource-manager-deployment-manifest.yml
- name: 'Re-generate the website links'
env:
WEB_BASE_URL: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'WEB_BASE_URL')] }}

run: |
sed -e "s#{{WEB_BASE_URL}}#$WEB_BASE_URL#" web/index-template.html > web/index.html
- name: 'Update the website'
uses: 'azure/CLI@v2'
with:
inlineScript: |
az storage blob upload-batch -s web -d '$web' --account-name $STORAGE_ACCOUNT_NAME --overwrite

0 comments on commit 116f171

Please sign in to comment.