Update README.md #17
This file contains 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: Update docs to Azure Blob storage website | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Rebuild docs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- run: npm install | |
- run: npm run docs | |
- run: npx insert-gtag tag-manager ./docs ${{ secrets.GTM_CONTAINER_ID }} | |
- name: Connect Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Upload docs | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az storage blob delete-batch --source '$web' --pattern docs/WshBasicPackage/* --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --auth-mode key | |
az storage blob upload-batch --destination '$web/docs/WshBasicPackage' --source ./docs --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --auth-mode key | |
- name: Purge CDN endpoint | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az afd endpoint purge --content-paths '/docs/WshBasicPackage/*' --profile-name ${{ secrets.AFD_PROFILE_NAME }} --endpoint-name ${{ secrets.AFD_ENDPOINT_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP_NAME }} --subscription ${{ secrets.SUBSCRIPTION_ID }} --domains assets.tuckn.net | |
- name: logout | |
if: always() | |
run: az logout | |
- run: az cache purge | |
- run: az account clear |