diff --git a/.env.example.ionos b/.env.example.ionos index 8fc2425..d862975 100644 --- a/.env.example.ionos +++ b/.env.example.ionos @@ -1,11 +1,7 @@ -# Those variables stay empty -# because we don't use Keystatic on IONOS. -KEYSTATIC_GITHUB_CLIENT_ID= # empty -KEYSTATIC_GITHUB_CLIENT_SECRET= # empty -KEYSTATIC_SECRET= # empty +# For the static build, we only need the following variables. +# They need to be part of `.github/workflows/*build.yaml` +# They are enforced by `astro.config.mjs` `env.schema`` -# Those variables belong into `.github/workflows/*build.yaml` -# They are envored by `astro.config.mjs` `env.schema`` # KEYSTATIC_STORAGE_KIND: "local" # ASTRO_ENV: "production" # ASTRO_OUTPUT_MODE: "static" diff --git a/.env.example.local b/.env.example.local index 7bc4f82..b85a862 100644 --- a/.env.example.local +++ b/.env.example.local @@ -1,8 +1,9 @@ # Keystatic # Docs: https://keystatic.com/docs/github-mode -KEYSTATIC_GITHUB_CLIENT_ID= # empty -KEYSTATIC_GITHUB_CLIENT_SECRET= # empty -KEYSTATIC_SECRET= # empty +KEYSTATIC_GITHUB_CLIENT_ID= # Follow https://keystatic.com/docs/github-mode#setting-up-git-hub-mode +KEYSTATIC_GITHUB_CLIENT_SECRET= # Dito +KEYSTATIC_SECRET= # Dito +PUBLIC_KEYSTATIC_GITHUB_APP_SLUG=radinfra-de-keystatic # https://github.com/organizations/FixMyBerlin/settings/apps/radinfra-de-keystatic KEYSTATIC_STORAGE_KIND=local ASTRO_ENV=development diff --git a/.env.example.netlify b/.env.example.netlify index aef4c91..bdacbd3 100644 --- a/.env.example.netlify +++ b/.env.example.netlify @@ -3,6 +3,7 @@ KEYSTATIC_GITHUB_CLIENT_ID= # See Bitwarden KEYSTATIC_GITHUB_CLIENT_SECRET= # See Bitwarden KEYSTATIC_SECRET= # See Bitwarden +PUBLIC_KEYSTATIC_GITHUB_APP_SLUG=radinfra-de-keystatic KEYSTATIC_STORAGE_KIND=github ASTRO_ENV=staging @@ -10,3 +11,5 @@ ASTRO_OUTPUT_MODE=server ASTRO_USE_NETLIFY_ADAPTER=true # Those variables need to be added to the Netlify site settings manually. +# To create them, setup Keystatic for Github on local, following https://keystatic.com/docs/github-mode#setting-up-git-hub-mode +# To edit the Github application, see https://github.com/Thinkmill/keystatic/pull/1358/files diff --git a/astro.config.mjs b/astro.config.mjs index 3ed5120..1376abd 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -26,7 +26,7 @@ const { ASTRO_OUTPUT_MODE, ASTRO_USE_NETLIFY_ADAPTER } = loadEnv( export default defineConfig({ site: 'https://www.radinfra.de/', integrations: [ - ASTRO_OUTPUT_MODE === 'hybrid' ? keystatic() : undefined, + ASTRO_OUTPUT_MODE === 'static' ? undefined : keystatic(), tailwind({ // https://github.com/withastro/astro/tree/main/packages/integrations/tailwind#applybasestyles applyBaseStyles: false, diff --git a/keystatic.config.ts b/keystatic.config.ts index 6e37432..af94f4d 100644 --- a/keystatic.config.ts +++ b/keystatic.config.ts @@ -1,11 +1,12 @@ import { config } from '@keystatic/core' +import { KEYSTATIC_STORAGE_KIND } from 'astro:env/client' import { keystaticCampaignsConfig } from 'keystatic/keystatic.campaigns.config' import { keystaticPostsConfig } from 'keystatic/keystatic.posts.config' export default config({ storage: { // https://keystatic.com/docs/github-mode#setting-up-git-hub-mode - kind: import.meta.env.PUBLIC_ASTRO_STORAGE_KIND, + kind: KEYSTATIC_STORAGE_KIND, repo: { owner: 'FixMyBerlin', name: 'radinfra.de',