forked from ubiquity/work.ubq.fi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update the deploy.yml and build.yml
- Loading branch information
1 parent
624bf22
commit ae6bd0e
Showing
3 changed files
with
53 additions
and
28 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Check if required environment variables are set | ||
if [ -z "$CLOUDFLARE_ACCOUNT_ID" ] || [ -z "$CLOUDFLARE_API_TOKEN" ] || [ -z "$GITHUB_REPOSITORY" ] || \ | ||
[ -z "$VOYAGEAI_API_KEY" ] || [ -z "$SUPABASE_URL" ] || [ -z "$SUPABASE_ANON_KEY" ]; then | ||
echo "Error: Required environment variables are not set" | ||
exit 1 | ||
fi | ||
|
||
# Convert repository name format | ||
REPOSITORY_NAME=$GITHUB_REPOSITORY | ||
REPOSITORY_NAME=${REPOSITORY_NAME//./-} | ||
|
||
# Make the API call to Cloudflare | ||
curl -X PUT \ | ||
"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/${REPOSITORY_NAME}/deployment_configs" \ | ||
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \ | ||
-H "Content-Type: application/json" \ | ||
--data '{ | ||
"deployment_configs": { | ||
"production": { | ||
"env_vars": { | ||
"VOYAGE_API_KEY": { | ||
"value": "'"${VOYAGEAI_API_KEY}"'", | ||
"type": "secret_text" | ||
}, | ||
"SUPABASE_URL": { | ||
"value": "'"${SUPABASE_URL}"'", | ||
"type": "secret_text" | ||
}, | ||
"SUPABASE_ANON_KEY": { | ||
"value": "'"${SUPABASE_ANON_KEY}"'", | ||
"type": "secret_text" | ||
} | ||
} | ||
} | ||
} | ||
}' |
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