Update publish-docs.yaml #15
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@v3 | |
- name: Rebuild docs | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12' | |
- 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 upload-batch --destination '$web/docs/WshJest' --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/WshJest/*' --profile-name ${{ secrets.AFD_PROFILE_NAME }} --endpoint-name ${{ secrets.AFD_ENDPOINT_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP_NAME }} --subscription ${{ secrets.SUBSCRIPTION_NAME }} --domains assets.tuckn.net | |
# Azure logout | |
- name: logout | |
run: az logout | |
if: always() |