diff --git a/.github/workflows/main-branch.yml b/.github/workflows/main-branch.yml index 2216a4a..158bdc1 100644 --- a/.github/workflows/main-branch.yml +++ b/.github/workflows/main-branch.yml @@ -47,9 +47,40 @@ jobs: - name: Run Astro check run: npm run astro:check + deploy: + name: Deploy to Netlify + needs: [prettier, typescript, astro] + if: github.repository == 'KonradSzwarc/devscard' + runs-on: ubuntu-latest + outputs: + deploy-url: ${{ steps.netlify.outputs.deploy-url }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm + - name: Install dependencies + run: npm ci + - name: Run Astro build command + run: npm run build + - name: Deploy to Netlify + id: netlify + uses: nwtgck/actions-netlify@v2 + with: + publish-dir: dist + production-branch: main + github-token: ${{ secrets.GITHUB_TOKEN }} + production-deploy: true + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 1 + percy: name: Run Percy check if: github.repository == 'KonradSzwarc/devscard' + needs: deploy runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -68,39 +99,6 @@ jobs: PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} run: npx percy snapshot dist/ - deploy: - name: Deploy to Netlify - needs: [prettier, typescript, astro] - if: github.repository == 'KonradSzwarc/devscard' - runs-on: ubuntu-latest - outputs: - deploy-url: ${{ steps.netlify.outputs.deploy-url }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: npm - - name: Install dependencies - run: npm ci - - name: Run Astro build command - run: npm run build - env: - PUBLIC_GA_MEASUREMENT_ID: ${{ secrets.PUBLIC_GA_MEASUREMENT_ID }} - PUBLIC_CLARITY_PROJECT_ID: ${{ secrets.PUBLIC_CLARITY_PROJECT_ID }} - - name: Deploy to Netlify - id: netlify - uses: nwtgck/actions-netlify@v2 - with: - publish-dir: dist - production-branch: main - github-token: ${{ secrets.GITHUB_TOKEN }} - production-deploy: true - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - timeout-minutes: 1 - lighthouse: name: Run Lighthouse check if: github.repository == 'KonradSzwarc/devscard' diff --git a/README.md b/README.md index 739eb26..74a31c3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ A fully customizable template you can use to create your online (and paper) resu - **πŸ”Ά Built-in icon sets** β€” choose from over 100 000 [Iconify](https://iconify.design/) icons to represent your skills. - **🌍 I18n** β€” customize your resume's locale, date formatting, and used translations. - **πŸ”Ž SEO friendly** β€” the entire website is designed with SEO in mind. All SEO-related config properties are required and well-described. -- **πŸ“Š Analytics** β€” built-in support for [Google Analytics](https://analytics.google.com/) and [Clarity](https://clarity.microsoft.com/). The only you need to do is provide their IDs. - **🏭 Favicons generation** β€” invoke one command to generate all favicons and full app manifest for your website. - **πŸ›  Data helpers** β€” use built-in helpers to define your skills/socials once and reuse them across the configuration. - **πŸ”€ Data transformers** β€” utilize type-safe data transformers to create multiple variants of your resume without duplicating your data. diff --git a/astro.config.ts b/astro.config.ts index 16b004c..74bae08 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -1,18 +1,12 @@ import image from '@astrojs/image'; import tailwind from '@astrojs/tailwind'; -import partytown from '@astrojs/partytown'; import compress from 'astro-compress'; import { defineConfig } from 'astro/config'; import { visualizer } from 'rollup-plugin-visualizer'; // https://astro.build/config export default defineConfig({ - integrations: [ - tailwind(), - image(), - compress(), - partytown({ config: { forward: ['dataLayer.push', 'clarity.push'] } }), - ], + integrations: [tailwind(), image(), compress()], vite: { plugins: [visualizer()], resolve: { diff --git a/package-lock.json b/package-lock.json index f6edcb4..9c032bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ }, "devDependencies": { "@astrojs/image": "0.12.1", - "@astrojs/partytown": "1.0.2", "@astrojs/react": "1.2.2", "@astrojs/tailwind": "2.1.3", "@percy/cli": "1.17.0", @@ -162,16 +161,6 @@ "vfile-message": "^3.0.0" } }, - "node_modules/@astrojs/partytown": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@astrojs/partytown/-/partytown-1.0.2.tgz", - "integrity": "sha512-+pUjLxdp0SYqUO+X+FjFN95KxK7w4Rs5gIMQ7scKUWd2073D3/5hTlij9qNmX5Bk/tFHUfTivKIZ5p233Lpa9Q==", - "dev": true, - "dependencies": { - "@builder.io/partytown": "^0.7.1", - "mrmime": "^1.0.0" - } - }, "node_modules/@astrojs/prism": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-1.0.1.tgz", @@ -603,15 +592,6 @@ "node": ">=6.9.0" } }, - "node_modules/@builder.io/partytown": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@builder.io/partytown/-/partytown-0.7.5.tgz", - "integrity": "sha512-Zbr2Eo0AQ4yzmQr/36/h+6LKjmdVBB3Q5cGzO6rtlIKB/IOpbQVUZW+XAnhpJmJr9sIF97OZjgbhG9k7Sjn4yw==", - "dev": true, - "bin": { - "partytown": "bin/partytown.cjs" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -9771,16 +9751,6 @@ "vfile-message": "^3.0.0" } }, - "@astrojs/partytown": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@astrojs/partytown/-/partytown-1.0.2.tgz", - "integrity": "sha512-+pUjLxdp0SYqUO+X+FjFN95KxK7w4Rs5gIMQ7scKUWd2073D3/5hTlij9qNmX5Bk/tFHUfTivKIZ5p233Lpa9Q==", - "dev": true, - "requires": { - "@builder.io/partytown": "^0.7.1", - "mrmime": "^1.0.0" - } - }, "@astrojs/prism": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-1.0.1.tgz", @@ -10102,12 +10072,6 @@ "to-fast-properties": "^2.0.0" } }, - "@builder.io/partytown": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@builder.io/partytown/-/partytown-0.7.5.tgz", - "integrity": "sha512-Zbr2Eo0AQ4yzmQr/36/h+6LKjmdVBB3Q5cGzO6rtlIKB/IOpbQVUZW+XAnhpJmJr9sIF97OZjgbhG9k7Sjn4yw==", - "dev": true - }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", diff --git a/package.json b/package.json index f7fe197..9fec3a3 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ }, "devDependencies": { "@astrojs/image": "0.12.1", - "@astrojs/partytown": "1.0.2", "@astrojs/react": "1.2.2", "@astrojs/tailwind": "2.1.3", "@percy/cli": "1.17.0", diff --git a/src/web/analytics/analytics.astro b/src/web/analytics/analytics.astro deleted file mode 100644 index 5502ba0..0000000 --- a/src/web/analytics/analytics.astro +++ /dev/null @@ -1,10 +0,0 @@ ---- -import Clarity from './clarity.astro'; -import GoogleAnalytics from './google-analytics.astro'; - -const GA_MEASUREMENT_ID = import.meta.env.PUBLIC_GA_MEASUREMENT_ID; -const CLARITY_PROJECT_ID = import.meta.env.PUBLIC_CLARITY_PROJECT_ID; ---- - -{GA_MEASUREMENT_ID && } -{CLARITY_PROJECT_ID && } diff --git a/src/web/analytics/clarity.astro b/src/web/analytics/clarity.astro deleted file mode 100644 index b28cd6f..0000000 --- a/src/web/analytics/clarity.astro +++ /dev/null @@ -1,22 +0,0 @@ ---- -export interface Props { - id: string; -} - -const { id } = Astro.props; ---- - - diff --git a/src/web/analytics/google-analytics.astro b/src/web/analytics/google-analytics.astro deleted file mode 100644 index ee4f5d7..0000000 --- a/src/web/analytics/google-analytics.astro +++ /dev/null @@ -1,17 +0,0 @@ ---- -export interface Props { - id: string; -} - -const { id } = Astro.props; ---- - - - diff --git a/src/web/components/layout.astro b/src/web/components/layout.astro index 9a9745c..54bd7dc 100644 --- a/src/web/components/layout.astro +++ b/src/web/components/layout.astro @@ -1,7 +1,6 @@ --- import type { Data } from '@/types/data'; -import Analytics from '@/web/analytics/analytics.astro'; -import Head from './head.astro'; +import Head from '@/web/head/head.astro'; export interface Props extends Pick {} @@ -12,7 +11,6 @@ const { meta, i18n } = Astro.props; - diff --git a/src/web/components/head.astro b/src/web/head/head.astro similarity index 62% rename from src/web/components/head.astro rename to src/web/head/head.astro index d279185..695c7ea 100644 --- a/src/web/components/head.astro +++ b/src/web/head/head.astro @@ -1,9 +1,9 @@ --- import Fonts from '@/components/fonts.astro'; -import Favicons from '@/web/head/favicons.auto-generated.astro'; -import InitialTheme from '@/web/head/initial-theme.astro'; -import Meta from '@/web/head/meta.astro'; import type { MetaConfig } from '@/types/config/meta-config.types'; +import Favicons from './favicons.auto-generated.astro'; +import InitialTheme from './initial-theme.astro'; +import Meta from './meta.astro'; interface Props { meta: MetaConfig;