# This is a combination of 3 commits.
# This is the 1st commit message: fix: redirects + update root cdn url # This is the commit message #2: chore: workflow # This is the commit message #3: chore: naming
This commit is contained in:
parent
ed88631875
commit
88a4ec4acd
45 changed files with 1122 additions and 133 deletions
7
workers/rebuild/README.md
Normal file
7
workers/rebuild/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# rebuild worker
|
||||
|
||||
```bash
|
||||
wrangler deploy --env production
|
||||
|
||||
wrangler secret put DEPLOY_HOOK_URL --env production
|
||||
```
|
17
workers/rebuild/index.js
Normal file
17
workers/rebuild/index.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
export default {
|
||||
async scheduled(event, env, ctx) {
|
||||
const deployHookUrl = env.DEPLOY_HOOK_URL;
|
||||
|
||||
const response = await fetch(deployHookUrl, {
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
console.error(`Error triggering deploy: ${response.statusText}`, errorText);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Deploy triggered successfully');
|
||||
}
|
||||
};
|
10
workers/rebuild/wrangler.toml
Normal file
10
workers/rebuild/wrangler.toml
Normal file
|
@ -0,0 +1,10 @@
|
|||
name = "scheduled-rebuild-worker"
|
||||
main = "./index.js"
|
||||
compatibility_date = "2023-01-01"
|
||||
|
||||
account_id = ""
|
||||
workers_dev = true
|
||||
|
||||
[env.production]
|
||||
name = "scheduled-rebuild-worker-production"
|
||||
triggers = {crons = ["0 * * * *"]}
|
Reference in a new issue