This commit is contained in:
@@ -14,10 +14,8 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Chrome
|
||||
uses: browser-actions/setup-chrome@v2
|
||||
with:
|
||||
chrome-version: stable
|
||||
- name: Setup Firefox
|
||||
uses: browser-actions/setup-firefox@v1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
@@ -32,6 +30,8 @@ jobs:
|
||||
run: npm run build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
PUPPETEER_BROWSER: firefox
|
||||
PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-firefox.outputs.firefox-path }}
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v6
|
||||
|
||||
@@ -25,12 +25,14 @@ const PDF_CONFIG = {
|
||||
|
||||
// Browser launch options for different environments
|
||||
const getLaunchOptions = (): LaunchOptions => {
|
||||
const chromePath = process.env.PUPPETEER_EXECUTABLE_PATH;
|
||||
const browserPath = process.env.PUPPETEER_EXECUTABLE_PATH;
|
||||
const browser = process.env.PUPPETEER_BROWSER || 'chrome';
|
||||
const options: LaunchOptions = {
|
||||
headless: true,
|
||||
browser: browser as 'chrome' | 'firefox',
|
||||
};
|
||||
if (chromePath) {
|
||||
options.executablePath = chromePath;
|
||||
if (browserPath) {
|
||||
options.executablePath = browserPath;
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user