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 diff --git a/.github/workflows/build-and-push-develop.yml b/.github/workflows/build-and-push-develop.yml index 7a29167..876cfd3 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 @@ -43,7 +53,7 @@ jobs: with: context: . file: ./.docker/Dockerfile.dev - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ghcr.io/${{ env.REPO_LC }}-dev:latest, ghcr.io/${{ env.REPO_LC }}-dev:${{ env.COMMIT_SHA }} diff --git a/.github/workflows/build-and-push-production.yml b/.github/workflows/build-and-push-production.yml index d8ab2b9..e95c5e2 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: @@ -84,7 +94,7 @@ jobs: with: context: . file: ./.docker/Dockerfile.prod - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ghcr.io/${{ env.REPO_LC }}:${{ env.RELEASE_VERSION }}, ghcr.io/${{ env.REPO_LC }}:latest diff --git a/.github/workflows/build-and-push-stage.yml b/.github/workflows/build-and-push-stage.yml index c8b6623..d2e6c00 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/* @@ -72,7 +82,7 @@ jobs: with: context: . file: ./.docker/Dockerfile.stage - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ghcr.io/${{ env.REPO_LC }}-stage:${{ env.RELEASE_VERSION }}-preview, ghcr.io/${{ env.REPO_LC }}-stage:latest, ghcr.io/${{ env.REPO_LC }}-stage:${{ env.COMMIT_SHA }} @@ -82,7 +92,7 @@ jobs: with: context: . file: ./.docker/Dockerfile.stage - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ghcr.io/${{ env.REPO_LC }}-stage:latest, ghcr.io/${{ env.REPO_LC }}-stage:${{ env.COMMIT_SHA }} diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 061f4d1..f2a94aa 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -75,6 +75,7 @@ jobs: build_and_deploy_stage: runs-on: ubuntu-latest + needs: draft_new_release permissions: contents: write packages: write @@ -117,7 +118,7 @@ jobs: with: context: . file: ./.docker/Dockerfile.stage - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ghcr.io/${{ env.REPO_LC }}-stage:${{ env.RELEASE_VERSION }}-preview, ghcr.io/${{ env.REPO_LC }}-stage:latest, ghcr.io/${{ env.REPO_LC }}-stage:${{ env.COMMIT_SHA }} diff --git a/CHANGELOG.md b/CHANGELOG.md index c2dec5c..e48cdcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v1.0.2] - 2024-08-01 + +### Changed + +- refactor: change cookies to local storage (#77) +- ci: run only github actions when needed (#76) + ## [v1.0.1] - 2024-07-17 ### Changed @@ -44,7 +51,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release - Create "Page under construction" Page -[Unreleased]: https://github.com/green-ecolution/project-website/compare/v1.0.1...HEAD +[Unreleased]: https://github.com/green-ecolution/project-website/compare/v1.0.2...HEAD + +[v1.0.2]: https://github.com/green-ecolution/project-website/compare/v1.0.1...v1.0.2 [v1.0.1]: https://github.com/green-ecolution/project-website/compare/v1.0.0...v1.0.1 diff --git a/k8s/values/develop.yaml b/k8s/values/develop.yaml index 0423db9..6f71d4e 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: "d1b889b" ingress: enabled: true className: "traefik" diff --git a/package.json b/package.json index 1eff671..b012fa2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "project-website", "private": true, - "version": "v1.0.1", + "version": "v1.0.2", "type": "module", "scripts": { "dev": "vite", 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() {