mirror of
https://github.com/actions/deploy-pages.git
synced 2026-03-30 18:14:52 +00:00
WIP
This commit is contained in:
32
dist/index.js
generated
vendored
32
dist/index.js
generated
vendored
@@ -9960,11 +9960,11 @@ async function getSignedArtifactMetadata({ runtimeToken, workflowRunId, artifact
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createPagesDeployment({ githubToken, artifactUrl, buildVersion, idToken, isPreview = false }) {
|
async function createPagesDeployment({ githubToken, artifactId, buildVersion, idToken, isPreview = false }) {
|
||||||
const octokit = github.getOctokit(githubToken)
|
const octokit = github.getOctokit(githubToken)
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
artifact_url: artifactUrl,
|
artifact_id: artifactId,
|
||||||
pages_build_version: buildVersion,
|
pages_build_version: buildVersion,
|
||||||
oidc_token: idToken
|
oidc_token: idToken
|
||||||
}
|
}
|
||||||
@@ -10141,9 +10141,33 @@ class Deployment {
|
|||||||
|
|
||||||
console.log(artifactData)
|
console.log(artifactData)
|
||||||
|
|
||||||
// TODO create deployment
|
if (artifactData?.size > ONE_GIGABYTE) {
|
||||||
|
core.warning(
|
||||||
|
`Uploaded artifact size of ${artifactData?.size} bytes exceeds the allowed size of ${SIZE_LIMIT_DESCRIPTION}. Deployment might fail.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return
|
const deployment = await createPagesDeployment({
|
||||||
|
githubToken: this.githubToken,
|
||||||
|
artifactId: artifactData.id,
|
||||||
|
buildVersion: this.buildVersion,
|
||||||
|
idToken,
|
||||||
|
isPreview: this.isPreview
|
||||||
|
})
|
||||||
|
|
||||||
|
if (deployment) {
|
||||||
|
this.deploymentInfo = {
|
||||||
|
...deployment,
|
||||||
|
id: deployment.id || deployment.status_url?.split('/')?.pop() || this.buildVersion,
|
||||||
|
pending: true
|
||||||
|
}
|
||||||
|
this.startTime = Date.now()
|
||||||
|
}
|
||||||
|
|
||||||
|
core.info(`Created deployment for ${this.buildVersion}, ID: ${this.deploymentInfo?.id}`)
|
||||||
|
core.debug(JSON.stringify(deployment))
|
||||||
|
|
||||||
|
return deployment
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(error.stack)
|
core.error(error.stack)
|
||||||
|
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -149,11 +149,11 @@ async function getSignedArtifactMetadata({ runtimeToken, workflowRunId, artifact
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createPagesDeployment({ githubToken, artifactUrl, buildVersion, idToken, isPreview = false }) {
|
async function createPagesDeployment({ githubToken, artifactId, buildVersion, idToken, isPreview = false }) {
|
||||||
const octokit = github.getOctokit(githubToken)
|
const octokit = github.getOctokit(githubToken)
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
artifact_url: artifactUrl,
|
artifact_id: artifactId,
|
||||||
pages_build_version: buildVersion,
|
pages_build_version: buildVersion,
|
||||||
oidc_token: idToken
|
oidc_token: idToken
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,9 +67,33 @@ class Deployment {
|
|||||||
|
|
||||||
console.log(artifactData)
|
console.log(artifactData)
|
||||||
|
|
||||||
// TODO create deployment
|
if (artifactData?.size > ONE_GIGABYTE) {
|
||||||
|
core.warning(
|
||||||
|
`Uploaded artifact size of ${artifactData?.size} bytes exceeds the allowed size of ${SIZE_LIMIT_DESCRIPTION}. Deployment might fail.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return
|
const deployment = await createPagesDeployment({
|
||||||
|
githubToken: this.githubToken,
|
||||||
|
artifactId: artifactData.id,
|
||||||
|
buildVersion: this.buildVersion,
|
||||||
|
idToken,
|
||||||
|
isPreview: this.isPreview
|
||||||
|
})
|
||||||
|
|
||||||
|
if (deployment) {
|
||||||
|
this.deploymentInfo = {
|
||||||
|
...deployment,
|
||||||
|
id: deployment.id || deployment.status_url?.split('/')?.pop() || this.buildVersion,
|
||||||
|
pending: true
|
||||||
|
}
|
||||||
|
this.startTime = Date.now()
|
||||||
|
}
|
||||||
|
|
||||||
|
core.info(`Created deployment for ${this.buildVersion}, ID: ${this.deploymentInfo?.id}`)
|
||||||
|
core.debug(JSON.stringify(deployment))
|
||||||
|
|
||||||
|
return deployment
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(error.stack)
|
core.error(error.stack)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user