From 1258af65e9135efadec12cc7362e0bc371a73bf9 Mon Sep 17 00:00:00 2001 From: Tyom Semonov Date: Tue, 3 Oct 2023 21:05:02 +0100 Subject: [PATCH] Update GH actions and lint/format --- .github/workflows/build.yaml | 17 +++++++++++------ .github/workflows/deploy.yaml | 22 +++++++++++++++------- .prettierignore | 1 + README.md | 10 +++++----- package.json | 2 +- src/app.html | 3 +-- src/components/ExperienceItem.svelte | 1 + src/components/Summary.svelte | 2 ++ svelte.config.js | 4 +++- 9 files changed, 40 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3c147d9..8e4fbf8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,16 +12,21 @@ jobs: name: build and test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 16 + + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 8 - name: Install dependencies - run: yarn install --frozen-lockfile + run: pnpm install - name: Lint source - run: yarn lint + run: pnpm lint - name: Build app and generate PDF - run: yarn predeploy + run: pnpm predeploy diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ec70604..0ce443c 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -9,18 +9,26 @@ jobs: name: build and deploys runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 16 + + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 8 - name: Install dependencies - run: yarn install --frozen-lockfile + run: pnpm install + + - name: Lint source + run: pnpm lint - - name: Build app and Storybook and prepare for deployment - run: yarn predeploy + - name: Build app and generate PDF + run: pnpm predeploy env: - GA_TRACKING_ID: UA-332655-6 + PUBLIC_GA_MEASUREMENT_ID: G-T41297TYQ1 - name: Deploy to GH Pages uses: peaceiris/actions-gh-pages@v3 diff --git a/.prettierignore b/.prettierignore index 20d4232..5d091fb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,4 @@ build/** node_modules/** dist/ storybook-static/ +pnpm-lock.yaml diff --git a/README.md b/README.md index 4129057..4a5b2d8 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ The static site is deployed to GH Pages. To deploy manually (this also runs pred ## Environment variables -| Variable | Description | -|:-------------------------|:-----------------------------------------| -| GIT_USER_EMAIL | Git user email for pushing to GH pages | -| GIT_USER_NAME | Git user name for pushing to GH pages | -| PUBLIC_GA_MEASUREMENT_ID | Google Analytics measuremet ID | +| Variable | Description | +| :----------------------- | :------------------------------------- | +| GIT_USER_EMAIL | Git user email for pushing to GH pages | +| GIT_USER_NAME | Git user name for pushing to GH pages | +| PUBLIC_GA_MEASUREMENT_ID | Google Analytics measuremet ID | diff --git a/package.json b/package.json index e319421..d180312 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "vite build", "start": "vite preview", "create-pdf": "node scripts/create-pdf.cjs", - "predeploy": "rm -rf build && yarn create-pdf && yarn build && yarn build-storybook && cp -a storybook-static/. build/storybook && echo tyom.semonov.com > build/CNAME", + "predeploy": "rm -rf build && pnpm create-pdf && 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 .", "format": "prettier --write .", diff --git a/src/app.html b/src/app.html index 31df335..2f31ac8 100644 --- a/src/app.html +++ b/src/app.html @@ -9,8 +9,7 @@ href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" /> - %sveltekit.head% - %unocss-svelte-scoped.global% + %sveltekit.head% %unocss-svelte-scoped.global%
%sveltekit.body%
diff --git a/src/components/ExperienceItem.svelte b/src/components/ExperienceItem.svelte index af038f5..7deccd4 100644 --- a/src/components/ExperienceItem.svelte +++ b/src/components/ExperienceItem.svelte @@ -58,6 +58,7 @@ {#if description}
+ {@html description}
{/if} diff --git a/src/components/Summary.svelte b/src/components/Summary.svelte index 603c0c8..0cd7477 100644 --- a/src/components/Summary.svelte +++ b/src/components/Summary.svelte @@ -28,6 +28,7 @@

{name}

{title}

+ {@html details}
@@ -93,6 +94,7 @@
{type}
+ {@html details}
diff --git a/svelte.config.js b/svelte.config.js index 04c6672..b792410 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -11,7 +11,9 @@ export default { }), ], kit: { - adapter: staticAdapter(), + adapter: staticAdapter({ + fallback: 'index.html', + }), alias: { $data: 'data', $src: 'src',