Skip to content

Commit f7893e0

Browse files
committed
deploy and update search index
1 parent 5a8eeb7 commit f7893e0

File tree

3 files changed

+44
-52
lines changed

3 files changed

+44
-52
lines changed

.docsearch/tdasset.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"lvl3": "article h3, .markdown h3",
3333
"lvl4": "article h4, .markdown h4",
3434
"lvl5": "article h5, .markdown h5",
35-
"text": "article p, article li, .markdown p, .markdown li"
35+
"text": "article p, article li, .markdown p, .markdown li, article pre, .markdown pre"
3636
},
3737
"custom_settings": {
3838
"attributesForFaceting": [

.github/workflows/check_markdown.yaml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,7 @@ jobs:
3838
- name: Use custom zh config file
3939
uses: crate-ci/typos@v1.31.1
4040
with:
41-
files: 'zh_CN/**/*.md'
42-
config: .github/workflows/typos.toml
43-
44-
- name: Use custom en config file
45-
uses: crate-ci/typos@v1.31.1
46-
with:
47-
files: 'en_US/**/*.md'
48-
config: .github/workflows/typos.toml
49-
50-
- name: Use custom en config file
51-
uses: crate-ci/typos@v1.31.1
52-
with:
53-
files: '**/*.md'
41+
files: 'docs/**/*.md'
5442
config: .github/workflows/typos.toml
5543

5644
check-docs-linter-formatter:
@@ -62,12 +50,12 @@ jobs:
6250
- name: AutoCorrect
6351
uses: huacnlee/autocorrect-action@v2
6452
with:
65-
args: --lint docs/zh/* docs/en/*
53+
args: --lint docs/*
6654
- name: Report ReviewDog
6755
if: always()
6856
uses: tomchon/autocorrect-action@fix/review-dog
6957
env:
7058
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7159
with:
7260
reviewdog: true
73-
args: ./zh_CN/* ./en_US/* **/*.md
61+
args: ./docs/**/*.md

.github/workflows/deploy_docs.yaml

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- '.github/workflows/deploy_docs.yaml'
1212
branches:
1313
- init/chr/tdasset-docs
14+
- main
1415

1516
jobs:
1617
deploy:
@@ -46,46 +47,49 @@ jobs:
4647
python3 .github/scripts/generate_version.py $(git tag | egrep "v(.*)$" | xargs echo -n) > test_versions.json
4748
cat test_versions.json
4849
49-
# - name: build docs
50-
# run: |
51-
# pnpm install
52-
# pnpm run build
50+
- name: build docs
51+
run: |
52+
pnpm install
53+
pnpm run build
5354
54-
# - name: Azure Login
55-
# uses: azure/login@v2
56-
# with:
57-
# creds: ${{ secrets.AZURE_CREDENTIALS }}
55+
- name: Azure Login
56+
uses: azure/login@v2
57+
with:
58+
creds: ${{ secrets.AZURE_CREDENTIALS }}
5859

59-
# - name: upload docs to Azure Blob Storage
60-
# uses: azure/cli@v2
61-
# with:
62-
# azcliversion: 2.73.0
63-
# inlineScript: |
64-
# az storage blob upload-batch \
65-
# --account-name ${{ secrets.AZURE_STORAGE_ACCOUNT }} \
66-
# --destination '$web' \
67-
# --source build \
68-
# --overwrite \
69-
# --auth-mode key
70-
# echo "Uploaded EN docs to Azure Blob Storage"
60+
- name: upload docs to Azure Blob Storage
61+
uses: azure/cli@v2
62+
with:
63+
azcliversion: 2.73.0
64+
inlineScript: |
65+
az storage blob upload-batch \
66+
--account-name ${{ secrets.AZURE_STORAGE_ACCOUNT }} \
67+
--destination '$web' \
68+
--source build \
69+
--overwrite \
70+
--auth-mode key
71+
echo "Uploaded EN docs to Azure Blob Storage"
7172
72-
# - name: purge Azure CDN endpoint
73-
# uses: azure/cli@v2
74-
# with:
75-
# azcliversion: 2.73.0
76-
# inlineScript: |
77-
# az cdn endpoint purge \
78-
# --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} \
79-
# --profile-name ${{ secrets.AZURE_CDN_PROFILE }} \
80-
# --name ${{ secrets.AZURE_CDN_ENDPOINT }} \
81-
# --content-paths "/*" "/index.html" "/"
82-
# echo "Azure CDN purged for docs.tdasset.ai"
73+
- name: purge Azure CDN endpoint
74+
uses: azure/cli@v2
75+
with:
76+
azcliversion: 2.73.0
77+
inlineScript: |
78+
az cdn endpoint purge \
79+
--resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} \
80+
--profile-name ${{ secrets.AZURE_CDN_PROFILE }} \
81+
--name ${{ secrets.AZURE_CDN_ENDPOINT }} \
82+
--content-paths "/*" "/index.html" "/"
83+
echo "Azure CDN purged for docs.tdasset.ai"
8384
84-
- name: update search index
85-
uses: Swilder-M/docsearch-scraper-simple@next
85+
- name: Run docsearch-scraper
8686
env:
8787
APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
8888
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
89-
with:
90-
docs_type: ${{ env.DOCS_TYPE }}
91-
docs_version: ${{ env.VERSION }}
89+
run: |
90+
CONFIG="$(cat ${{ github.workspace }}/.docsearch/tdasset.json | jq -r tostring)" \
91+
docker run --rm \
92+
-e APPLICATION_ID \
93+
-e API_KEY \
94+
-e CONFIG="$CONFIG" \
95+
algolia/docsearch-scraper

0 commit comments

Comments
 (0)