generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from ShivTestOrg/scraperui
fix: adds scraper logic and token handling
- Loading branch information
Showing
17 changed files
with
791 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SUPABASE_URL="" | ||
SUPABASE_KEY="" | ||
VOYAGEAI_API_KEY="" |
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,42 @@ | ||
#!/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_KEY" ]; then | ||
echo "Error: Required environment variables are not set" | ||
exit 1 | ||
fi | ||
|
||
# Extract just the repository name from org/repo format | ||
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2) | ||
# Replace dots with hyphens | ||
REPOSITORY_NAME=${REPOSITORY_NAME//./-} | ||
|
||
# Echo the repository name | ||
echo "Repository name: $REPOSITORY_NAME" | ||
|
||
# Make the API call to Cloudflare | ||
curl -X PATCH \ | ||
"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": { | ||
"VOYAGEAI_API_KEY": { | ||
"value": "'"${VOYAGEAI_API_KEY}"'", | ||
"type": "secret_text" | ||
}, | ||
"SUPABASE_URL": { | ||
"value": "'"${SUPABASE_URL}"'", | ||
"type": "secret_text" | ||
}, | ||
"SUPABASE_KEY": { | ||
"value": "'"${SUPABASE_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
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 |
---|---|---|
|
@@ -18,3 +18,6 @@ cypress/videos | |
|
||
# vscode | ||
.vscode | ||
|
||
# Cloudflare | ||
.dev.vars |
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.