Skip to content

Commit

Permalink
feat: background
Browse files Browse the repository at this point in the history
  • Loading branch information
tresabhi committed Dec 20, 2024
1 parent 8517ecf commit 6d83268
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,11 @@ jobs:
- name: AppArmor hack
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns

- name: Build assets
run: bun run build:assets --all-targets --depot --production
- name: Start server and build assets
run: |
bun dev:website &
SERVER_PID=$!
bun run build:assets --all-targets --depot --production
kill $SERVER_PID || true
5 changes: 1 addition & 4 deletions packages/scripts/src/buildAssets/blitzkitTankIcons.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BLITZKIT_TANK_ICON_SIZE, fetchTankDefinitions } from '@blitzkit/core';
import { exec } from 'child_process';
import { launch } from 'puppeteer';
import sharp from 'sharp';
import { commitAssets } from '../core/github/commitAssets';
Expand All @@ -9,8 +8,6 @@ export async function blitzkitTankIcons() {
console.log('Building blitzkit tank icons...');

console.log('Starting website dev server...');

const child = exec('cd ../.. && bun dev:website');
const browser = await launch();
const page = await browser.newPage();
const tanks = Object.values((await fetchTankDefinitions()).tanks);
Expand Down Expand Up @@ -44,7 +41,7 @@ export async function blitzkitTankIcons() {
files.push({ path: `icons/tanks/blitzkit/${id}.webp`, content });
}

child.kill('SIGHUP');
await page.close();
await browser.close();

await commitAssets('tank icons', files);
Expand Down

0 comments on commit 6d83268

Please sign in to comment.