forked from Reggionick/s3-deploy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
40 lines (36 loc) · 1.04 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
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 immutable = getBooleanInput('immutable');
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,
immutable,
filesToInclude,
});
} catch (error) {
core.setFailed(error.message);
}
}
run();