0.1.5 • Published 5 months ago
@icebreakers/deploy v0.1.5
@icebreakers/deploy
deploy website to cdn
Install
yarn add -D @icebreakers/deploy
Usages
Cli
# .env
TENCENT_SECRET_ID=
TENCENT_SECRET_KEY=
TENCENT_COS_REGION=
TENCENT_COS_BUCKET=
# default deploy
ice-deploy
# deploy before clean bucket
ice-deploy -c
# deploy dir
ice-deploy --dir build
script
require('dotenv').config()
const { TencentCOSWebsiteDeployer } = require('@icebreakers/deploy')
async function main() {
const { TENCENT_SECRET_ID, TENCENT_SECRET_KEY, TENCENT_COS_REGION, TENCENT_COS_BUCKET } = process.env
const deployer = new TencentCOSWebsiteDeployer({
SecretKey: TENCENT_SECRET_KEY,
SecretId: TENCENT_SECRET_ID
})
await deployer.uploadDir({
Bucket: TENCENT_COS_BUCKET,
Region: TENCENT_COS_REGION,
clean: true,
targetDir: 'build'
})
}
main()