Skip to content

Instantly share code, notes, and snippets.

@marcus-sa
Last active March 19, 2025 20:39
Show Gist options
  • Save marcus-sa/c95d5f24ad7c4ee9f3396c05de2b4894 to your computer and use it in GitHub Desktop.
Save marcus-sa/c95d5f24ad7c4ee9f3396c05de2b4894 to your computer and use it in GitHub Desktop.
catalyze api
import {
Cloudflare,
CloudflarePages,
CloudflareWorkers,
} from '@catalyze/cloudflare';
import { DeploymentStage, Pipeline, catalyze } from '@catalyze/core';
import { BuildingStage } from '@catalyze/core/elements/stages/building-stage.js';
const backend = new CloudflareWorkers('backend', {});
const frontend = new CloudflarePages('frontend', {});
const deployCustomers = new Pipeline('deploy', {
stages: [
new BuildingStage('build').use(stage => {
stage.addStepGroup([backend.build(), frontend.build()]);
}),
new DeploymentStage('deploy').use(stage => {
stage
.addStepGroup([backend.deploy(), frontend.deploy()])
.rollbackOnFailure({ self: true });
}),
],
});
catalyze({
pipelines: [deployCustomers],
catalysts: [new Cloudflare({})],
});
import {
Cloudflare,
CloudflarePages,
CloudflareWorkers,
} from '@catalyze/cloudflare';
import { DeploymentStage, Pipeline, catalyze } from '@catalyze/core';
import { BuildingStage } from '@catalyze/core/elements/stages/building-stage.js';
const backend = new CloudflareWorkers('backend', {});
const frontend = new CloudflarePages('frontend', {});
const deployCustomers = new Pipeline('deploy').use(pipeline => {
pipeline.addStage(
new BuildingStage('build').use(stage => {
stage.addStepGroup([backend.build(), frontend.build()]);
}),
);
pipeline.addStage(
new DeploymentStage('deploy').use(stage => {
stage
.addStepGroup([backend.deploy(), frontend.deploy()])
.rollbackOnFailure({ self: true });
}),
);
});
catalyze({
pipelines: [deployCustomers],
catalysts: [new Cloudflare({})],
});
import {
Cloudflare,
CloudflarePages,
CloudflareWorkers,
} from '@catalyze/cloudflare';
import { DeploymentStage, Pipeline, catalyze } from '@catalyze/core';
import { BuildingStage } from '@catalyze/core/elements/stages/building-stage.js';
const backend = new CloudflareWorkers('backend', {});
const frontend = new CloudflarePages('frontend', {});
const deployCustomers = new Pipeline('deploy').use(pipeline => {
pipeline.addStage(
new BuildingStage('build').use(stage => {
stage.addStepGroup([backend.build(), frontend.build()]);
}),
);
pipeline.stage.deployment('deploy').use(stage => {
stage
.addStepGroup([backend.deploy(), frontend.deploy()])
.rollbackOnFailure({ self: true });
});
});
catalyze({
pipelines: [deployCustomers],
catalysts: [new Cloudflare({})],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment