Skip to content

Commit

Permalink
refactor: remove branch where deployid doesn't exist (#6087)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt authored Oct 25, 2023
1 parent 1e78527 commit 8a65ef3
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/utils/deploy/deploy-site.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const deploySite = async (
concurrentHash = DEFAULT_CONCURRENT_HASH,
concurrentUpload = DEFAULT_CONCURRENT_UPLOAD,
configPath = null,
deployId: deployIdOpt = null,
deployId,
deployTimeout = DEFAULT_DEPLOY_TIMEOUT,
draft = false,
filter,
Expand All @@ -37,8 +37,6 @@ export const deploySite = async (
hashAlgorithm,
manifestPath,
maxRetry = DEFAULT_MAX_RETRY,
// API calls this the 'title'
message: title,
siteEnv,
siteRoot,
skipFunctionsCache,
Expand Down Expand Up @@ -120,9 +118,9 @@ For more information, visit https://ntl.fyi/cli-native-modules.`)
phase: 'start',
})

let deploy
let deployParams = cleanDeep({
const deployParams = cleanDeep({
siteId,
deploy_id: deployId,
body: {
files,
functions,
Expand All @@ -133,19 +131,11 @@ For more information, visit https://ntl.fyi/cli-native-modules.`)
draft,
},
})
if (deployIdOpt === null) {
if (title) {
deployParams = { ...deployParams, title }
}
deploy = await api.createSiteDeploy(deployParams)
} else {
deployParams = { ...deployParams, deploy_id: deployIdOpt }
deploy = await api.updateSiteDeploy(deployParams)
}
let deploy = await api.updateSiteDeploy(deployParams)

if (deployParams.body.async) deploy = await waitForDiff(api, deploy.id, siteId, deployTimeout)

const { id: deployId, required: requiredFiles, required_functions: requiredFns } = deploy
const { required: requiredFiles, required_functions: requiredFns } = deploy

statusCb({
type: 'create-deploy',
Expand Down

1 comment on commit 8a65ef3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,668
  • Package size: 497 MB

Please sign in to comment.