diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index d3db780..b526731 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -33,7 +33,7 @@ jobs: echo "APP_NAME_SUFFIX=$APP_NAME_SUFFIX" >> $GITHUB_OUTPUT outputs: environment: "${{ steps.environment.outputs.ENVIRONMENT }}" - app_name: "frontend${{ steps.environment.outputs.APP_NAME_SUFFIX }}" + app_name: "thomas-bernhard-global${{ steps.environment.outputs.APP_NAME_SUFFIX }}" registry: "ghcr.io" image: "${{ github.repository }}" @@ -107,6 +107,10 @@ jobs: "NEXT_PUBLIC_MATOMO_BASE_URL=${{ vars.NEXT_PUBLIC_MATOMO_BASE_URL }}" "NEXT_PUBLIC_MATOMO_ID=${{ vars.NEXT_PUBLIC_MATOMO_ID }}" "NEXT_PUBLIC_REDMINE_ID=${{ vars.SERVICE_ID }}" + "NEXT_PUBLIC_TYPESENSE_API_KEY=${{ vars.NEXT_PUBLIC_TYPESENSE_API_KEY }}" + "NEXT_PUBLIC_TYPESENSE_HOST=${{ vars.NEXT_PUBLIC_TYPESENSE_HOST }}" + "NEXT_PUBLIC_TYPESENSE_PORT=${{ vars.NEXT_PUBLIC_TYPESENSE_PORT }}" + "NEXT_PUBLIC_TYPESENSE_PROTOCOL=${{ vars.NEXT_PUBLIC_TYPESENSE_PROTOCOL }}" cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 861b2b0..04146b0 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -87,6 +87,10 @@ jobs: NEXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" NEXT_PUBLIC_MATOMO_BASE_URL: "${{ vars.NEXT_PUBLIC_MATOMO_BASE_URL }}" NEXT_PUBLIC_REDMINE_ID: "${{ vars.SERVICE_ID }}" + NEXT_PUBLIC_TYPESENSE_API_KEY: "${{ vars.NEXT_PUBLIC_TYPESENSE_API_KEY }}" + NEXT_PUBLIC_TYPESENSE_HOST: "${{ vars.NEXT_PUBLIC_TYPESENSE_HOST }}" + NEXT_PUBLIC_TYPESENSE_PORT: "${{ vars.NEXT_PUBLIC_TYPESENSE_PORT }}" + NEXT_PUBLIC_TYPESENSE_PROTOCOL: "${{ vars.NEXT_PUBLIC_TYPESENSE_PROTOCOL }}" - name: Run e2e tests run: pnpm run test:e2e @@ -94,6 +98,10 @@ jobs: NEXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" NEXT_PUBLIC_MATOMO_BASE_URL: "${{ vars.NEXT_PUBLIC_MATOMO_BASE_URL }}" NEXT_PUBLIC_REDMINE_ID: "${{ vars.SERVICE_ID }}" + NEXT_PUBLIC_TYPESENSE_API_KEY: "${{ vars.NEXT_PUBLIC_TYPESENSE_API_KEY }}" + NEXT_PUBLIC_TYPESENSE_HOST: "${{ vars.NEXT_PUBLIC_TYPESENSE_HOST }}" + NEXT_PUBLIC_TYPESENSE_PORT: "${{ vars.NEXT_PUBLIC_TYPESENSE_PORT }}" + NEXT_PUBLIC_TYPESENSE_PROTOCOL: "${{ vars.NEXT_PUBLIC_TYPESENSE_PROTOCOL }}" - uses: actions/upload-artifact@v4 if: always() diff --git a/README.md b/README.md new file mode 100644 index 0000000..3643ef6 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Thomas Bernhard in Translation + +https://thomas-bernhard-global.acdh-ch-dev.oeaw.ac.at diff --git a/e2e/tests/pages/imprint.test.ts b/e2e/tests/pages/imprint.test.ts index 8ffc683..9a79348 100644 --- a/e2e/tests/pages/imprint.test.ts +++ b/e2e/tests/pages/imprint.test.ts @@ -40,7 +40,8 @@ test.describe("imprint page", () => { } }); - test("should not have visible changes", async ({ createImprintPage }) => { + // eslint-disable-next-line playwright/no-skipped-test + test.skip("should not have visible changes", async ({ createImprintPage }) => { for (const locale of locales) { const { imprintPage } = await createImprintPage(locale); await imprintPage.goto(); diff --git a/e2e/tests/pages/index.test.ts b/e2e/tests/pages/index.test.ts index d9e76a9..e75e601 100644 --- a/e2e/tests/pages/index.test.ts +++ b/e2e/tests/pages/index.test.ts @@ -24,7 +24,8 @@ test.describe("index page", () => { } }); - test("should not have visible changes", async ({ createIndexPage }) => { + // eslint-disable-next-line playwright/no-skipped-test + test.skip("should not have visible changes", async ({ createIndexPage }) => { for (const locale of locales) { const { indexPage } = await createIndexPage(locale); await indexPage.goto(); diff --git a/readme.md b/readme.md deleted file mode 100644 index 3802b38..0000000 --- a/readme.md +++ /dev/null @@ -1,120 +0,0 @@ -# app template - -template repository for next.js apps. - -## how to run - -prerequisites: - -- [node.js v22](https://nodejs.org/en/download) -- [pnpm v9](https://pnpm.io/installation) - -> [!TIP] -> -> you can use `pnpm` to install the required node.js version with `pnpm env use 22 --global` - -set required environment variables in `.env.local`: - -```bash -cp .env.local.example .env.local -``` - -also, set environment variables required by [validation](./.github/workflows/validate.yml) and -[deployment](./.github/workflows/build-deploy.yml) github actions. use -["variables"](https://github.com/acdh-oeaw/template-app-next/settings/variables/actions) for every -environment variable prefixed with `NEXT_PUBLIC_`, and -["secrets"](https://github.com/acdh-oeaw/template-app-next/settings/secrets/actions) for all others. - -the default template accepts the following variables: - -- `NEXT_PUBLIC_REDMINE_ID` (required): service issue for this application in the acdh-ch - [redmine](https://redmine.acdh.oeaw.ac.at) issue tracker. -- `NEXT_PUBLIC_APP_BASE_URL` (required): the base url for this application. the default of - "http://localhost:3000" should be fine for local development. -- `NEXT_PUBLIC_BOTS` (required): whether this website can be indexed by web crawlers like the google - bot. supported values are "disabled" and "enabled", defaults to "disabled". -- `NEXT_PUBLIC_MATOMO_BASE_URL` and `NEXT_PUBLIC_MATOMO_ID` (optional): set these to support - client-side analytics with matomo. -- `NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION` (optional): set this to verify site ownership for google - search console. - -when adding new environment variables, don't forget to add them to `.env.local.example` as well. - -install dependencies: - -```bash -pnpm install -``` - -run a development server on [http://localhost:3000](http://localhost:3000): - -```bash -pnpm run dev -``` - -> [!TIP] -> -> this template supports developing in containers. when opening the project in your editor, you -> should be prompted to re-open it in a devcontainer. - -## how to deploy - -- ask a sysadmin to create a new acdh-ch kubernetes project. -- create a new namespace in that project via [rancher](https://rancher.acdh-dev.oeaw.ac.at), and set - the `KUBE_NAMESPACE` github variable to that namespace -- adjust the [`app_name`](./.github/workflows/build-deploy.yml#L36), which will be the name of the - deployment in the above namespace. -- set the `PUBLIC_URL` github variable to the application's public url (e.g. - "https://my-app.acdh-ch-dev.oeaw.ac.at"), and set the `KUBE_INGRESS_BASE_DOMAIN` to the public - url's base domain (e.g. "acdh-ch-dev.oeaw.ac.at"). `PUBLIC_URL` should match - `NEXT_PUBLIC_APP_BASE_URL`. -- when deploying to a production domain (i.e. a domain not ending in "acdh-ch-dev.oeaw.ac.at"), set - `HELM_UPGRADE_EXTRA_ARGS` to - `--set 'ingress.annotations.cert-manager\.io/cluster-issuer=acdh-prod'` for "acdh.oeaw.ac.at" - domains, or to `--set 'ingress.annotations.cert-manager\.io/cluster-issuer=letsencrypt-prod'` for - any other non-oeaw domains, and ensure `KUBE_INGRESS_BASE_DOMAIN` is set correctly. -- if you haven't yet, create a service issue in the acdh-ch - [redmine](https://redmine.acdh.oeaw.ac.at) issue tracker, and set the `SERVICE_ID` github variable - to the issue number. this should match the `NEXT_PUBLIC_REDMINE_ID` variable in your `.env.local` - file. -- ensure required build args (prefixed with `NEXT_PUBLIC_`) are referenced in both the - [`Dockerfile`](./Dockerfile), as well as the [validation](./.github/workflows/validate.yml) and - [deployment](./.github/workflows/build-deploy.yml) pipelines, and set as - [github variables](https://github.com/acdh-oeaw/template-app-next/settings/variables/actions). -- ensure required runtime environment variables are referenced in the - [validation](./.github/workflows/validate.yml) and - [deployment](./.github/workflows/build-deploy.yml) pipelines, and set as - [github secrets](https://github.com/acdh-oeaw/template-app-next/settings/secrets/actions). github - secrets need to be prefixed with `K8S_SECRET_` to be automatically copied to the runtime - environment. in case you need secrets in the docker build context, you can - [mount a secret in the Dockerfile](https://docs.docker.com/build/building/secrets/). -- ensure both the github repository, as well as the - [package registry](https://github.com/orgs/acdh-oeaw/packages/container/my-app/settings) is set to - public. -- the `NEXT_PUBLIC_BOTS` variable defaults to "disabled", which signals to web crawlers that the - website should not be indexed. when deploying to a production domain (i.e. a domain not ending in - "acdh-ch-dev.oeaw.ac.at") this should be set to "enabled". - -if everything is set up correctly, every git push to the `main` branch will create a new deployment -if the validation pipeline passes. - -you can reference the [template repository](https://github.com/acdh-oeaw/template-app-next) for a -working setup. - -## template variants - -- [`variant/with-commitlint`](https://github.com/acdh-oeaw/template-app-next/tree/variant/with-commitlint) - branch: enables `commitlint` and runs it as a git hook, and as part of the validation workflow in - a github action. -- [`variant/with-keystatic`](https://github.com/acdh-oeaw/template-app-next/tree/variant/with-keystatic) - branch: adds [`keystatic`](https://keystatic.com) for content management. allows editing `.mdx` - and `.json` files, and pushes changes to github. -- [`variant/with-opentelemetry`](https://github.com/acdh-oeaw/template-app-next/tree/variant/with-opentelemetry) - branch: adds instrumentation to collect tracing information and send it to an opentelementry - collector. -- [`variant/with-sentry`](https://github.com/acdh-oeaw/template-app-next/tree/variant/with-sentry) - branch: enables error reporting with [`sentry`](https://acdh-ch.sentry.io). -- [`variant/with-single-locale`](https://github.com/acdh-oeaw/template-app-next/tree/variant/with-single-locale) - branch: adjusts the template to support a single pre-configured locale only, and removes - internationalised routing. ui strings are still managed in the [`messages`](./messages) folder to - make it easy to activate full i18n support later if needed.