diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3c3d8a6..f697efc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,6 +3,7 @@ name: Publish permissions: id-token: write contents: write + pages: write on: push: @@ -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 @@ -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