Skip to content

Commit

Permalink
Build PDF locally and commit it to Git
Browse files Browse the repository at this point in the history
With the latest updates the current PDF build process using Playwright is
having issues running the server in GH Actions. Instead of building it in GH
check in the PDF built locally.
  • Loading branch information
tyom committed Jan 5, 2024
1 parent 4ebcbc0 commit 2708016
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_modules
yarn-error.log
storybook-static
dist/
static/*.pdf
.env
.svelte/
.svelte-kit/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "vite build",
"start": "vite preview",
"create-pdf": "pnpm playwright test",
"predeploy": "rm -rf build && pnpm playwright test && pnpm build && pnpm build-storybook && cp -a storybook-static/. build/storybook && echo tyom.semonov.com > build/CNAME",
"predeploy": "rm -rf build && pnpm build && pnpm build-storybook && cp -a storybook-static/. build/storybook && echo tyom.semonov.com > build/CNAME",
"deploy": "gh-pages -d build --dotfiles",
"lint": "eslint --ignore-path .gitignore . && prettier --check .",
"postinstall": "pnpm exec playwright install chromium --with-deps",
Expand Down
25 changes: 2 additions & 23 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
import { defineConfig } from '@playwright/test';
import { networkInterfaces } from 'os';

function getIPAddress() {
const interfaces = networkInterfaces();
for (const name in interfaces) {
const iface = interfaces[name];

for (const alias of iface) {
if (
alias.family === 'IPv4' &&
alias.address !== '127.0.0.1' &&
!alias.internal
) {
return alias.address;
}
}
}
return '0.0.0.0';
}

const PORT = process.env.PORT || 5173;
const serverUrl = `http://${getIPAddress()}:${PORT}`;

console.log('Server URL:', serverUrl);
const serverUrl = `http://localhost:${PORT}`;

export default defineConfig({
webServer: {
command: 'pnpm run dev --host',
command: 'pnpm dev --host',
url: serverUrl,
reuseExistingServer: !process.env.CI,
},
Expand Down
Binary file added static/tyom-semonov-cv.pdf
Binary file not shown.

0 comments on commit 2708016

Please sign in to comment.