-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Publish | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- * | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
- name: Setup Yarn v3 | ||
run: | | ||
corepack enable | ||
corepack prepare yarn@stable --activate | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
- name: Build | ||
run: yarn run build | ||
- name: Publish | ||
run: | | ||
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc | ||
lerna publish from-git --yes | ||
- name: Build docs | ||
run: | | ||
yarn run generate-api-docs | ||
yarn run docs:build | ||
- name: Azure login | ||
uses: azure/login@v1 | ||
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/.vuepress/dist/" | ||
- name: Purge CDN endpoint | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: | | ||
az cdn endpoint purge --content-paths "/*" --profile-name "baklavajs" --name "baklavajs" --resource-group "Private" --no-wait | ||
- name: Azure Logout | ||
run: az logout | ||
if: always() |