Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] typedoc github action second fix for #2237 #2243 #2246

Merged
merged 11 commits into from
Jan 19, 2024
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
Loading