This commit is contained in:
@@ -14,16 +14,17 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup Chrome
|
- name: Install firefox runtime dependencies
|
||||||
uses: browser-actions/setup-chrome@v2
|
run: apt-get update && apt-get install -y libgtk-3-0 libasound2 libx11-xcb1
|
||||||
with:
|
|
||||||
chrome-version: stable
|
- name: Setup Firefox
|
||||||
|
id: setup-firefox
|
||||||
|
uses: browser-actions/setup-firefox@v1
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
@@ -32,6 +33,8 @@ jobs:
|
|||||||
run: npm run build
|
run: npm run build
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
PUPPETEER_BROWSER: firefox
|
||||||
|
PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-firefox.outputs.firefox-path }}
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
|
|||||||
@@ -25,12 +25,14 @@ const PDF_CONFIG = {
|
|||||||
|
|
||||||
// Browser launch options for different environments
|
// Browser launch options for different environments
|
||||||
const getLaunchOptions = (): LaunchOptions => {
|
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 = {
|
const options: LaunchOptions = {
|
||||||
headless: true,
|
headless: true,
|
||||||
|
browser: browser as 'chrome' | 'firefox',
|
||||||
};
|
};
|
||||||
if (chromePath) {
|
if (browserPath) {
|
||||||
options.executablePath = chromePath;
|
options.executablePath = browserPath;
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user