Skip to content

Commit

Permalink
Deploy: Fix env conditions, imports and examples files
Browse files Browse the repository at this point in the history
  • Loading branch information
tordans committed Nov 21, 2024
1 parent 06af152 commit c39ee7c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
10 changes: 3 additions & 7 deletions .env.example.ionos
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 4 additions & 3 deletions .env.example.local
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions .env.example.netlify
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
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
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
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion keystatic.config.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit c39ee7c

Please sign in to comment.