Skip to content

Commit

Permalink
chore: update publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat committed Oct 23, 2024
1 parent fab8ebb commit c8c9567
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Publish
permissions:
id-token: write
contents: write
pages: write

on:
push:
Expand All @@ -12,14 +13,17 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 20
uses: actions/setup-node@v3
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
- name: Setup Yarn v3
run: |
corepack enable
Expand All @@ -36,22 +40,10 @@ jobs:
run: |
yarn run generate-api-docs
yarn run docs:build
- name: Azure login
uses: azure/login@v1
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Publish docs
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob sync --account-name baklavajs -c '$web' -s "./docs/.vitepress/dist/"
- name: Purge CDN endpoint
uses: azure/CLI@v1
with:
inlineScript: |
az afd endpoint purge --content-paths "/*" --profile-name "baklavajs" --endpoint-name "baklavajs" --resource-group "Private" --no-wait
- name: Azure Logout
run: az logout
if: always()
path: "./docs/.vitepress/dist/"
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit c8c9567

Please sign in to comment.