Skip to content

Commit e183970

Browse files
joshuamoronyJoshua Morony
and
Joshua Morony
authored
feat: add functions folder to deploy (#134)
Co-authored-by: Joshua Morony <[email protected]>
1 parent 94f0734 commit e183970

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/deploy/index.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,20 @@ export default createBuilder(
168168
context.logger.info(
169169
`Deploying project from 📂 ./${builderConfig.outputPath}`
170170
);
171+
172+
let config = {};
173+
174+
if (builderConfig.functionsPath) {
175+
console.log(
176+
`Deploying functions from 📂 ./${builderConfig.functionsPath}`
177+
);
178+
config = { ...config, fnDir: builderConfig.functionsPath };
179+
}
180+
171181
const response = await client.deploy(
172182
siteId,
173-
builderConfig.outputPath
183+
builderConfig.outputPath,
184+
config
174185
);
175186
context.logger.info(
176187
`✔ Your updated site 🕸 is running at ${response.deploy.ssl_url}`

src/deploy/schema.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ export interface Schema {
33
configuration?: string;
44
noBuild?: boolean;
55
outputPath?: boolean;
6+
functionsPath?: boolean;
67
netlifyToken?: string;
78
siteId?: string;
89
baseHref?: string;
910
create?: boolean;
10-
withDeps?: boolean
11+
withDeps?: boolean;
1112
}

src/deploy/schema.json

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"type": "string",
2424
"description": "This is one of the options you can freely choose according to your needs. --- We will 'deploy' to this folder."
2525
},
26+
"functionsPath": {
27+
"type": "string",
28+
"description": "Path to the functions folder you want to deploy"
29+
},
2630
"netlifyToken": {
2731
"type": "string",
2832
"description": "Acess token give you the ability to communicate with netlify over API."

0 commit comments

Comments
 (0)