Skip to content

Commit

Permalink
[main] typedoc github action second fix for #2237 #2243 (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
siyuniu-ms authored Jan 19, 2024
1 parent 20f6356 commit 75c9971
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,27 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Snippet File
run: |
cd tools/applicationinsights-web-snippet
rush update
npm install
npm run build
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Update rush shrinkwrap dependencies (for different node versions)
run: node common/scripts/install-run-rush.js update --full
- run: npm install rollup -g
- run: npm install grunt-cli
- run: npm install
- run: node common/scripts/install-run-rush.js check
- run: node common/scripts/install-run-rush.js install
- run: npm run build --verbose
timeout-minutes: 20
- name: Inject Script
run: node ./tools/github-page-script-injection/injectScript.js
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
13 changes: 0 additions & 13 deletions _includes/snippet.html

This file was deleted.

10 changes: 9 additions & 1 deletion tools/github-page-script-injection/injectScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ scriptContent = scriptContent.replace('YOUR_CONNECTION_STRING', connectionString
scriptContent = `<script type="text/javascript">${scriptContent}</script>`;

// write this file into _include folder so that later github would reject it inside markdown files
const includeFolderFile = path.join(__dirname, '../../_includes/script.html');
const includeFolderPath = path.join(__dirname, '../../docs/_includes/');
const includeFolderFile = path.join(includeFolderPath, 'script.html');

// Check if the directory exists, create it if not
if (!fs.existsSync(includeFolderPath)) {
fs.mkdirSync(includeFolderPath, { recursive: true });
}

// Now, write the file
fs.writeFileSync(includeFolderFile, scriptContent, 'utf8');

// recursively process all html files under docs folder
Expand Down

0 comments on commit 75c9971

Please sign in to comment.