From f6eb2c0a02e25600fb022b3d269aacc604313cb0 Mon Sep 17 00:00:00 2001 From: Bruno Paz <184563+brpaz@users.noreply.github.com> Date: Sun, 12 Jun 2022 11:34:20 +0100 Subject: [PATCH] add envrinonment deploy --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f1768cc..86a6a9a 100644 --- a/index.js +++ b/index.js @@ -16115,6 +16115,7 @@ try { const projectName = (0, import_core.getInput)("projectName", { required: true }); const directory = (0, import_core.getInput)("directory", { required: true }); const gitHubToken = (0, import_core.getInput)("gitHubToken", { required: true }); + const environment = (0, import_core.getInput)("environment", { required: false }); const octokit = (0, import_github.getOctokit)(gitHubToken); const createPagesDeployment = async () => { await esm_default` @@ -16123,7 +16124,11 @@ try { $ export CLOUDFLARE_ACCOUNT_ID="${accountId}" } - $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" + if ${envrionment} { + $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --env="$[environment}" + } else { + $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" + } `; const response = await (0, import_undici.fetch)(`https://api.cloudflare.com/client/v4/accounts/${accountId}/pages/projects/${projectName}/deployments`, { headers: { Authorization: `Bearer ${apiToken}` } }); const {