diff --git a/frontend/services/deploy.ts b/frontend/services/deploy.ts new file mode 100644 index 0000000..dfacb1f --- /dev/null +++ b/frontend/services/deploy.ts @@ -0,0 +1,13 @@ +import type { TagListResponse, DeployResult } from './dto/deploy' + +export function getAvailableTags(slug: string): Promise { + return useApi().get(`/applications/${slug}/tags`, undefined, { + toast: false, + }) +} + +export function deploy(envId: number, tag: string): Promise { + return useApi().post(`/environments/${envId}/deploy`, { tag }, { + toast: false, + }) +} diff --git a/frontend/services/dto/deploy.ts b/frontend/services/dto/deploy.ts new file mode 100644 index 0000000..c3f2d28 --- /dev/null +++ b/frontend/services/dto/deploy.ts @@ -0,0 +1,9 @@ +type TagListResponse = { + tags: string[] +} + +type DeployResult = { + success: boolean + output: string + tag: string +}