Skip to content

Commit dbd8154

Browse files
githubactions-updated
0 parents  commit dbd8154

File tree

534 files changed

+12878
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

534 files changed

+12878
-0
lines changed

.github/serverless/direct_upload.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const {exec} = require('child_process');
2+
const {WranglerCmd} = require("./lib/cfutils");
3+
4+
const cmd = new WranglerCmd(process.env.DEPLOYMENT_ENVIRONMENT || 'production');
5+
exec(`${cmd.publishProject()}`, (error, stdout, stderr) => {
6+
if (error) {
7+
console.log(`error: ${error.message}`);
8+
process.exit(1);
9+
}
10+
if (stderr) {
11+
console.log(`stderr: ${stderr}`);
12+
return;
13+
}
14+
console.log(`stdout: ${stdout}`);
15+
});
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const fs = require('fs');
2+
const {VarsReader} = require('./lib/cfutils');
3+
4+
const v = new VarsReader('development');
5+
6+
const filename = '.dev.vars';
7+
let textData = '';
8+
const flattened = v.flattenVars();
9+
Object.keys(flattened).forEach((k) => {
10+
textData += `${k} = "${flattened[k]}"\n`;
11+
});
12+
textData += `DEPLOYMENT_ENVIRONMENT = ${process.env.DEPLOYMENT_ENVIRONMENT || 'development'}`;
13+
fs.writeFile(filename, textData, function (err) {
14+
if (err) {
15+
console.log(err);
16+
process.exit(1);
17+
}
18+
console.log(`${filename} has been updated!`);
19+
});
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Use in CI
2+
if test -f ".vars.toml"; then
3+
echo ".vars.toml exists."
4+
exit
5+
fi
6+
7+
cat << EOF > .vars.toml
8+
CLOUDFLARE_PROJECT_NAME = "$CLOUDFLARE_PROJECT_NAME"
9+
CLOUDFLARE_ACCOUNT_ID = "$CLOUDFLARE_ACCOUNT_ID"
10+
CLOUDFLARE_API_TOKEN = "$CLOUDFLARE_API_TOKEN"
11+
12+
PRODUCTION_BRANCH = "$PRODUCTION_BRANCH"
13+
14+
APP_VERSION = "v1"
15+
NODE_VERSION = "17.0"
16+
17+
DEPLOYMENT_ENVIRONMENT = "$DEPLOYMENT_ENVIRONMENT"
18+
EOF

.github/serverless/init_app_db.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const {exec} = require('child_process');
2+
const {WranglerCmd} = require("./lib/cfutils");
3+
4+
const cmd = new WranglerCmd(process.env.DEPLOYMENT_ENVIRONMENT || 'development');
5+
exec(cmd.createAppDb(), (error, stdout, stderr) => {
6+
if (error) {
7+
console.log(`error: ${error.message}`);
8+
}
9+
if (stderr) {
10+
console.log(`stderr: ${stderr}`);
11+
}
12+
if (stdout) {
13+
console.log(`stdout: ${stdout}`);
14+
}
15+
exec(cmd.createAppDbTables(), (error, stdout, stderr) => {
16+
if (error) {
17+
console.log(`error: ${error.message}`);
18+
}
19+
if (stderr) {
20+
console.log(`stderr: ${stderr}`);
21+
}
22+
if (stdout) {
23+
console.log(`stdout: ${stdout}`);
24+
}
25+
});
26+
});

.github/serverless/init_project.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const {InitProject} = require("./lib/cfutils");
2+
3+
const initProject = new InitProject();
4+
initProject.run();

.github/serverless/init_r2.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const {SetupR2} = require("./lib/cfutils");
2+
3+
const setupR2 = new SetupR2();
4+
setupR2.setupPublicBucket();

0 commit comments

Comments
 (0)