diff --git a/.env b/.env index db3a627..4f2844b 100644 --- a/.env +++ b/.env @@ -9,3 +9,6 @@ VERSION= NEXT_PUBLIC_API_URL=https://api.huwelijksplanner.online/api NEXT_PUBLIC_MATOMO_URL=https://stats.utrecht.nl/analytics/ NEXT_PUBLIC_MATOMO_SITE_ID=5 +NEXT_PUBLIC_NL_DESIGN_THEME_CLASSNAME=utrecht-theme +NEXT_PUBLIC_ORGANISATION_NAME=Gemeente Utrecht +NEXT_PUBLIC_FAV_ICON=https://www.utrecht.nl/favicon.ico diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..005a285 --- /dev/null +++ b/.env.development @@ -0,0 +1,3 @@ +NEXT_PUBLIC_NL_DESIGN_THEME_CLASSNAME=leiden-theme +NEXT_PUBLIC_ORGANISATION_NAME=Gemeente Leiden +NEXT_PUBLIC_FAV_ICON=https://gemeente.leiden.nl/typo3conf/ext/leiden_template/Resources/Public/Images/favicon/favicon-96x96.png diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..6bb850a --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +NEXT_PUBLIC_NL_DESIGN_THEME_CLASSNAME= +NEXT_PUBLIC_ORGANISATION_NAME= +NEXT_PUBLIC_FAV_ICON= diff --git a/.github/workflows/huwelijksplanner-page-deploy.yml b/.github/workflows/huwelijksplanner-page-deploy.yml new file mode 100644 index 0000000..a6c50cc --- /dev/null +++ b/.github/workflows/huwelijksplanner-page-deploy.yml @@ -0,0 +1,52 @@ +name: Deploy the Huwelijksplanner Page to GitHub Pages + +env: # Change these to your preferences any image url can also be a base encoded image + GITHUB_PAGES_BRANCH: gh-pages + + NL_DESIGN_THEME_CLASSNAME: leiden-theme + ORGANISATION_NAME: Gemeente Leiden + FAV_ICON: https://gemeente.leiden.nl/typo3conf/ext/leiden_template/Resources/Public/Images/favicon/favicon-96x96.png + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Get the Huwelijksplanner Code + uses: actions/checkout@v2 + with: + repository: ConductionNL/utrecht-huwelijksplanner + ref: main + + # With special thanxs to https://github.com/SpicyPizza/create-envfile + - name: Make envfile + uses: SpicyPizza/create-envfile@v2.0 + with: + envkey_NEXT_PUBLIC_NL_DESIGN_THEME_CLASSNAME: ${{ env.NL_DESIGN_THEME_CLASSNAME }} + envkey_NEXT_PUBLIC_ORGANISATION_NAME: ${{ env.ORGANISATION_NAME }} + envkey_NEXT_PUBLIC_FAV_ICON: ${{ env.FAV_ICON }} + file_name: .env.production + fail_on_empty: true + sort_keys: false + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Build application + run: npm run build + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.1.0 + with: + branch: ${{ env.GITHUB_PAGES_BRANCH }} + folder: .next diff --git a/pages/_app.tsx b/pages/_app.tsx index 063c779..9ea1017 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -11,9 +11,6 @@ import { MarriageOptionsProvider } from "../src/context/MarriageOptionsContext"; import { matomo } from "../src/matomo"; const MyApp = ({ Component, pageProps }: AppProps) => { - const ClassName = "leiden-theme"; - const OrganisationName = ClassName === "leiden-theme" ? "Gemeente Leiden" : "Gemeente Utrecht"; - useEffect(() => { if (process.env.NEXT_PUBLIC_MATOMO_URL) { matomo({ @@ -21,12 +18,10 @@ const MyApp = ({ Component, pageProps }: AppProps) => { siteId: process.env.NEXT_PUBLIC_MATOMO_SITE_ID, }); } - window.sessionStorage.setItem("NL_DESIGN_THEME_CLASSNAME", ClassName); - window.sessionStorage.setItem("ORGANISATION_NAME", OrganisationName); }, []); return ( -