Skip to content

Commit

Permalink
debug: test log SITES_CHANGED
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcguin committed Aug 22, 2024
1 parent 191d379 commit 32c39d9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ jobs:
run: |
if [[ ${{ steps.changes.outputs.packages }} == true ]] || [[ ${{ steps.changes.outputs.deps }} == true ]]; then
node ./scripts/build_sites.mjs --all
echo "continue=true" >> $GITHUB_OUTPUT
elif [[ ${{ steps.changes.outputs.sites }} == true ]]; then
node ./scripts/build_sites.mjs
echo "continue=true" >> $GITHUB_OUTPUT
else
# successful step, but do not continue with a deployment
echo "continue=false" >> $GITHUB_OUTPUT
Expand All @@ -57,7 +59,7 @@ jobs:
publish:
needs: prepare
name: Publish to Cloudflare Pages
if: ${{ ! needs.prepare.outputs.continue == true }}
if: ${{ needs.prepare.outputs.continue == true }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
Expand Down
35 changes: 19 additions & 16 deletions scripts/build_sites.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ try {
}

const allSites = JSON.parse(SITES);
console.log("SITES_CHANGED", SITES_CHANGED);
// if (doBuildAll) {
// }
/**
* Core dependencies or a common package changed.
* Rebuild all sites.
Expand All @@ -26,24 +29,24 @@ try {
* This is a key value pair where keys are the package name in the monorepo
* and values are the corresponding project name for the website in Cloudflare
* */
for (const [key, value] of Object.entries(allSites)) {
console.log({ key, value });
}
// for (const [key, value] of Object.entries(allSites)) {
// console.log({ key, value });
// }
} catch (error) {
console.error("Error building sites", error);
exit(1);
}

const matrix = {
include: [
{
project: "unicorn-demo",
package: "unicorn-demo",
},
],
};

appendFileSync(
process.env.GITHUB_OUTPUT,
`matrix=${JSON.stringify(matrix)}${os.EOL}`
);
// const matrix = {
// include: [
// {
// project: "unicorn-demo",
// package: "unicorn-demo",
// },
// ],
// };
//
// appendFileSync(
// process.env.GITHUB_OUTPUT,
// `matrix=${JSON.stringify(matrix)}${os.EOL}`
// );

0 comments on commit 32c39d9

Please sign in to comment.