You've already forked AstralRinth
forked from didirus/AstralRinth
deploy(frontend): debug variables
This commit is contained in:
24
.github/workflows/frontend-deploy.yml
vendored
24
.github/workflows/frontend-deploy.yml
vendored
@@ -53,6 +53,21 @@ jobs:
|
|||||||
node-version-file: .nvmrc
|
node-version-file: .nvmrc
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
|
- name: Inject build variables
|
||||||
|
working-directory: ./apps/frontend
|
||||||
|
run: |
|
||||||
|
if [ "${{ steps.meta.outputs.env }}" == "staging" ]; then
|
||||||
|
echo "Injecting staging variables from wrangler.jsonc..."
|
||||||
|
jq -r '.env.staging.vars | to_entries[] | "export \(.key)=\(.value|@sh)"' wrangler.jsonc \
|
||||||
|
| tee /dev/stderr \
|
||||||
|
| source /dev/stdin
|
||||||
|
else
|
||||||
|
echo "Injecting production variables from wrangler.jsonc..."
|
||||||
|
jq -r '.vars | to_entries[] | "export \(.key)=\(.value|@sh)"' wrangler.jsonc \
|
||||||
|
| tee /dev/stderr \
|
||||||
|
| source /dev/stdin
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./apps/frontend
|
working-directory: ./apps/frontend
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
@@ -60,13 +75,8 @@ jobs:
|
|||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
working-directory: ./apps/frontend
|
working-directory: ./apps/frontend
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ steps.meta.outputs.env }}" == "staging" ]; then
|
echo $BASE_URL
|
||||||
echo "Injecting staging variables from wrangler.jsonc..."
|
echo $BROWSER_BASE_URL
|
||||||
jq -r '.env.staging.vars | to_entries[] | "export \(.key)=\(.value|@sh)"' wrangler.jsonc | source /dev/stdin
|
|
||||||
else
|
|
||||||
echo "Injecting production variables from wrangler.jsonc..."
|
|
||||||
jq -r '.vars | to_entries[] | "export \(.key)=\(.value|@sh)"' wrangler.jsonc | source /dev/stdin
|
|
||||||
fi
|
|
||||||
pnpm build
|
pnpm build
|
||||||
env:
|
env:
|
||||||
CF_PAGES_BRANCH: ${{ github.ref_name }}
|
CF_PAGES_BRANCH: ${{ github.ref_name }}
|
||||||
|
|||||||
Reference in New Issue
Block a user