-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add and use
@ashgw/env
(#421)
* build: add `ts-env` * chore: clearup constants * fix: mdx lint errors * chore: refactor the mdx service * test: build * fix: load env vars correctly * build: add dotenv in catalog * chore: remove uncessary env vars * chore: finish off `www` env setup * build: create the env package * chore: add more strictness with zod * fix: jiti not detecting global `env` package * build: add `jiti` in catalog * refactor: make the blog identical to www * chore: delete the build action * build: add husky in root * ci: improve `setup-env` action * ci: cleanup `NODE_ENV` inputs * ci: update the whole workflow * fix: env var bash script clash with GH * fix: add missing action checkout * fix: smol typo * fix: add vercel upload `.env` step * fix: remove the redundant `--yes` env push option * chore: switch `staging` with `preview` * chore: remove and add back Vercel env vars * fix: add envirnoment retries * chore: hold state * fix: with a new scheme * fix: smol bug * fix: missing yes option * chore: use `jq` instead for parsing * revert: back to old logic * chore: bug WIP * fix: use the installed Vercel version * ci: add new way to sync env vars * fix: fill in actual vars * fix: switch different layout * fix: actually correct the name spelling * fix: uncomment error var * fix: cleanup again * fix: new setup * fix: add missing shell * fix: remove all the shit mane * chore: add missing comment * fix: add `with-dotenv` * revert: add `with-dotenv` * chore: import path using ES modules * ci: add `ready-for-preview` label check * ci: add `ready-for-preview` label check for `www` * build: add `pnpm` in `engine` * build: transpile packages * feat: add `@ashgw/ts-env` as an internal package * build: run dedupe * build: make it work * fix: remove with env * fix: remove `with-env` * fix: remove the `dtoenv` CLI * fix: remove `@ashgw/ts-env` from the workspace & use the npm version * fix: remove TODOs
- Loading branch information
Showing
91 changed files
with
4,591 additions
and
4,270 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
name: 'Setup Environment Variables' | ||
description: 'Sets up env from GitHub Secrets' | ||
name: "Setup Environment Variables" | ||
description: "Sets up env from GitHub Secrets" | ||
inputs: | ||
ENV_VARS: | ||
description: 'Environment variables to set up in .env.local' | ||
NODE_ENV: | ||
description: "either 'development', 'preview', or 'production' & defo not 'prod' or 'dev'" | ||
required: true | ||
GA_ID: | ||
description: 'Google Analytics ID to add to .env' | ||
NEXT_PUBLIC_WWW_URL: | ||
required: true | ||
NEXT_PUBLIC_BLOG_URL: | ||
required: true | ||
NEXT_PUBLIC_WWW_GOOGLE_ANALYTICS_ID: | ||
required: true | ||
NEXT_PUBLIC_BLOG_GOOGLE_ANALYTICS_ID: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up .env | ||
shell: bash | ||
run: | | ||
echo "${{ inputs.ENV_VARS }}" >> .env.local | ||
echo "GA_ID='${{ inputs.GA_ID }}'" >> .env # Store GA_ID in .env | ||
declare -A env_vars=( | ||
["NODE_ENV"]="${{ inputs.NODE_ENV }}" | ||
["NEXT_PUBLIC_WWW_URL"]="${{ inputs.NEXT_PUBLIC_WWW_URL }}" | ||
["NEXT_PUBLIC_BLOG_URL"]="${{ inputs.NEXT_PUBLIC_BLOG_URL }}" | ||
["NEXT_PUBLIC_WWW_GOOGLE_ANALYTICS_ID"]="${{ inputs.NEXT_PUBLIC_WWW_GOOGLE_ANALYTICS_ID }}" | ||
["NEXT_PUBLIC_BLOG_GOOGLE_ANALYTICS_ID"]="${{ inputs.NEXT_PUBLIC_BLOG_GOOGLE_ANALYTICS_ID }}" | ||
) | ||
for key in "${!env_vars[@]}"; do | ||
echo "${key}='${env_vars[$key]}'" >> .env | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
. "$(dirname -- "$0")/_/husky.sh" | ||
# pnpm lint | ||
# pnpm test | ||
# TODO: uncomment this later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.