Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = async ({ core, changes, deletions, operation, siteEnv, branch,
file = file.replace('src/pages/', '');

const theFilePath = `${pathPrefix}/${file}`;
const deleteUrl = `https://admin.hlx.page/live/adobedocs/${edsSiteEnv}/${codeRepoBranch}${theFilePath}`;
const deleteUrl = `https://admin.hlx.page/${operation}/adobedocs/${edsSiteEnv}/${codeRepoBranch}${theFilePath}`;
const deleteCmd = `curl -XDELETE -vi ${args} ${deleteUrl}`;


Expand All @@ -58,7 +58,7 @@ module.exports = async ({ core, changes, deletions, operation, siteEnv, branch,
return;
}

console.log(`::group:: Deleting ${theFilePath} \n${deleteExecOut} \n::endgroup::`);
console.log(`::group:: Deleting ${operation} on ${theFilePath} \nThe command: ${deleteCmd} \n${deleteExecOut} \n::endgroup::`);
});
});
}
9 changes: 8 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
pathPrefix: "${{ needs.set-state.outputs.path_prefix }}"
});

- name: Deploy to prod
- name: Deploy to prod (Step 1 of 2)
if: needs.set-state.outputs.deploy_prod == 'true' && steps.changed-files-specific.outputs.any_modified == 'true'
uses: actions/github-script@v7
with:
Expand All @@ -129,6 +129,13 @@ jobs:
pathPrefix: "${{ needs.set-state.outputs.path_prefix }}"
});

- name: Deploy to prod (Step 2 of 2)
if: needs.set-state.outputs.deploy_prod == 'true' && steps.changed-files-specific.outputs.any_modified == 'true'
uses: actions/github-script@v7
with:
script: |
const script = require('./.github/scripts/deploy.js');

await script({
core,
changes: ${{ steps.changed-files-specific.outputs.all_changed_files }},
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/resuse-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Reuse Deployment
on:
workflow_dispatch:
inputs:
env:
description: "Select environment to deploy to"
type: choice
required: true
default: "stage"
options:
- stage
- prod
baseSha:
description: "Use base SHA commit to deploy from (empty string defaults to last commit before HEAD)"
type: string
required: false
default: ""

jobs:
reuse_deployment:
name: Reuse Deployment
uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy.yml@main
with:
env: ${{ inputs.env }}
baseSha: ${{ inputs.baseSha }}