From a77d33fc94ace7838fe50a0e1b3719ffb927471e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 17 Jul 2024 08:08:13 +0000 Subject: [PATCH 1/9] chore: update dev image to commit 63d53ea --- k8s/values/develop.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/values/develop.yaml b/k8s/values/develop.yaml index 0423db9..83551c3 100644 --- a/k8s/values/develop.yaml +++ b/k8s/values/develop.yaml @@ -5,7 +5,7 @@ deployment: image: repository: ghcr.io/green-ecolution/project-website-dev pullPolicy: Always - tag: "1ffbc46" + tag: "63d53ea" ingress: enabled: true className: "traefik" From f2f92556e7d29a600ae4a84095c40590e01d5c6b Mon Sep 17 00:00:00 2001 From: Cedrik Hoffmann Date: Wed, 24 Jul 2024 21:54:55 +0200 Subject: [PATCH 2/9] feat: add .dockerignore --- .dockerignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4056d41 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +.docker/ +!.docker/nginx.conf +.git/ +.github/ +dist/ +k8s/ +node_modules/ +.dockerignore +.editorconfig +.gitignore +.node-version +CHANGELOG.md +README.md From b7ac50e904c2b9452cd4bf5d02def62de001a990 Mon Sep 17 00:00:00 2001 From: Cedrik Hoffmann Date: Wed, 24 Jul 2024 22:05:06 +0200 Subject: [PATCH 3/9] ci/cd: specify path in github action when to run build --- .github/workflows/build-and-push-develop.yml | 10 ++++++++++ .github/workflows/build-and-push-production.yml | 10 ++++++++++ .github/workflows/build-and-push-stage.yml | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/.github/workflows/build-and-push-develop.yml b/.github/workflows/build-and-push-develop.yml index 7a29167..343ab68 100644 --- a/.github/workflows/build-and-push-develop.yml +++ b/.github/workflows/build-and-push-develop.yml @@ -1,6 +1,16 @@ name: Build and Push Docker Image Develop "on": push: + paths: + - "**/**" + - "!.github/**" + - "!k8s/**" + - "!.dockerignore" + - "!.editorconfig" + - "!.gitignore" + - "!.node-version" + - "!CHANGELOG.md" + - "!README.md" branches: - develop diff --git a/.github/workflows/build-and-push-production.yml b/.github/workflows/build-and-push-production.yml index d8ab2b9..18f7eed 100644 --- a/.github/workflows/build-and-push-production.yml +++ b/.github/workflows/build-and-push-production.yml @@ -2,6 +2,16 @@ name: Build and Push Docker Image Production on: pull_request: + paths: + - "**/**" + - "!.github/**" + - "!k8s/**" + - "!.dockerignore" + - "!.editorconfig" + - "!.gitignore" + - "!.node-version" + - "!CHANGELOG.md" + - "!README.md" branches: - main types: diff --git a/.github/workflows/build-and-push-stage.yml b/.github/workflows/build-and-push-stage.yml index c8b6623..09b8535 100644 --- a/.github/workflows/build-and-push-stage.yml +++ b/.github/workflows/build-and-push-stage.yml @@ -2,6 +2,16 @@ name: Build and Push Docker Image Staging "on": workflow_dispatch: push: + paths: + - "**/**" + - "!.github/**" + - "!k8s/**" + - "!.dockerignore" + - "!.editorconfig" + - "!.gitignore" + - "!.node-version" + - "!CHANGELOG.md" + - "!README.md" branches: - release/* - hotfix/* From a3ede5c9155e6742421b572f4bc56179ab4d4b5d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 24 Jul 2024 20:32:02 +0000 Subject: [PATCH 4/9] chore: update dev image to commit a77d33f --- k8s/values/develop.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/values/develop.yaml b/k8s/values/develop.yaml index 83551c3..118e266 100644 --- a/k8s/values/develop.yaml +++ b/k8s/values/develop.yaml @@ -5,7 +5,7 @@ deployment: image: repository: ghcr.io/green-ecolution/project-website-dev pullPolicy: Always - tag: "63d53ea" + tag: "a77d33f" ingress: enabled: true className: "traefik" From ffa88520f1337e504a5af399ae6cb72d7a0f9e18 Mon Sep 17 00:00:00 2001 From: Cedrik Hoffmann Date: Wed, 24 Jul 2024 23:17:14 +0200 Subject: [PATCH 5/9] feat: change cookie to localStorage --- src/tsx/components/cards/WelcomeCard.tsx | 4 +-- src/tsx/components/homepage/HomepageHero.tsx | 10 +++--- src/tsx/helper/cookies.ts | 32 -------------------- src/tsx/helper/storage.ts | 7 +++++ 4 files changed, 14 insertions(+), 39 deletions(-) delete mode 100644 src/tsx/helper/cookies.ts create mode 100644 src/tsx/helper/storage.ts diff --git a/src/tsx/components/cards/WelcomeCard.tsx b/src/tsx/components/cards/WelcomeCard.tsx index cd927aa..06f698a 100644 --- a/src/tsx/components/cards/WelcomeCard.tsx +++ b/src/tsx/components/cards/WelcomeCard.tsx @@ -3,7 +3,7 @@ import Arrow from '../../icons/Arrow'; import Lottie from 'lottie-react'; import logoAnimation from '../../../json/logoAnimation.json'; import { useOutsideClick } from '../../hooks/useOutsideClick'; -import { hasCookie } from '../../helper/cookies'; +import { isInitialLoad } from '../../helper/storage'; interface WelcomeCardProps { onClose: () => void; @@ -29,7 +29,7 @@ const WelcomeCard: React.FC = ({ onClose, handleStartAnmiation }; useEffect(() => { - if (! hasCookie('green_ecolution_initial_load') && isOverlayVisible) { + if (isInitialLoad() && isOverlayVisible) { const timer = setTimeout(() => { setIsVisible(true) }, delay + 200); return () => clearTimeout(timer); } diff --git a/src/tsx/components/homepage/HomepageHero.tsx b/src/tsx/components/homepage/HomepageHero.tsx index 0504c9b..9fe33a1 100644 --- a/src/tsx/components/homepage/HomepageHero.tsx +++ b/src/tsx/components/homepage/HomepageHero.tsx @@ -2,7 +2,7 @@ import { useState, useEffect } from "react"; import Arrow from "../../icons/Arrow"; import HomepageOverlay from "./HomepageOverlay"; import HomepageHeroTrees from "./HomepageHeroTrees"; -import { setCookie, hasCookie } from "../../helper/cookies"; +import { setInitialLoad as setInitialLoadHelper, isInitialLoad as isInitialLoadHelper } from "../../helper/storage"; function HomepageHero() { const [isOverlayVisible, setIsOverlayVisible] = useState(false); @@ -14,7 +14,7 @@ function HomepageHero() { if (isInitialLoad) { setIsInitialLoad(false); - setCookie('green_ecolution_initial_load'); + setInitialLoadHelper(); } }; @@ -41,8 +41,8 @@ function HomepageHero() { }, [isOverlayVisible]); useEffect(() => { - if (! hasCookie('green_ecolution_initial_load') - && ! isOverlayVisible + if (isInitialLoadHelper() + && !isOverlayVisible && window.matchMedia('(min-width: 1280px)').matches ) { setIsInitialLoad(true); @@ -76,7 +76,7 @@ function HomepageHero() {