chore: upload to AWS S3 for each version tag (#178)

* chore: add deployment action

* chore: add secrets

* chore: trigger build

* chore: add try/catch and rename profile arg

* chore: trigger deployment on tag with version

* chore: remove deployment from prebublish script

* fix: regexp

* fix: glob instead of regexp on tag

* chore: add caching of node_modules for bundling
This commit is contained in:
Sergey Dubovyk
2020-08-14 11:45:26 +03:00
committed by GitHub
parent d10c3cb756
commit f3d8cb61ad
3 changed files with 46 additions and 5 deletions

View File

@@ -12,13 +12,18 @@ execSync(`tar -zcvf ${fileNameLatest} dist`);
const argv = yargs
.option('aws_profile', {
.option('aws-profile', {
alias: 'p',
type: 'string',
})
.argv;
let profile = !!argv.aws_profile ? `--profile ${argv.aws_profile}` : '';
let profile = !!argv.awsProfile ? `--profile ${argv.awsProfile}` : '';
try {
execSync(`aws s3 cp ${fileName} s3://openapi-cli-dist ${profile}`);
execSync(`aws s3 cp ${fileNameLatest} s3://openapi-cli-dist ${profile}`);
} catch (e) {
process.stderr.write(e.output);
}
execSync(`aws s3 cp ${fileName} s3://openapi-cli-dist ${profile}`);
execSync(`aws s3 cp ${fileNameLatest} s3://openapi-cli-dist ${profile}`);