forked from Reggionick/s3-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (23 loc) · 938 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const core = require('@actions/core');
const deploy = require('./deploy');
function getBooleanInput(name) {
return core.getInput(name).toLowerCase() === 'true';
}
async function run() {
try {
const folder = core.getInput('folder');
const bucket = core.getInput('bucket');
const bucketRegion = core.getInput('bucket-region');
const distId = core.getInput('dist-id');
const invalidation = core.getInput('invalidation') || '/';
const deleteRemoved = core.getInput('delete-removed') || false;
const noCache = getBooleanInput('no-cache');
const private = getBooleanInput('private');
const cache = core.getInput('cache') || null;
const filesToInclude = core.getInput('files-to-include') || null;
await deploy({ folder, bucket, bucketRegion, distId, invalidation, deleteRemoved, noCache, private, cache, filesToInclude });
} catch (error) {
core.setFailed(error.message);
}
}
run();