Skip to content

Commit

Permalink
updates build action
Browse files Browse the repository at this point in the history
  • Loading branch information
klalicki committed Mar 14, 2024
1 parent f282dda commit 36398b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(lazyImagesPlugin, { appendInitScript: false });
eleventyConfig.addPlugin(embedYouTube);

let p = {};
console.log("environment is " + process.env.NODE_ENV);
if (process.env.NODE_ENV === "build") {
console.log("running in production");
console.log("URL base is " + urlBase);
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
// this should be set
p = { pathPrefix: urlBase };
}

// Return your Object options:
eleventyConfig.addPassthroughCopy({ "./theme/assets": "assets" });
eleventyConfig.addPassthroughCopy({ "./img": "img" });
Expand Down Expand Up @@ -138,14 +148,6 @@ module.exports = function (eleventyConfig) {
}
});

let p = {};
if (process.env.NODE_ENV === "build") {
console.log("running in production");
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
// this should be set
p = { pathPrefix: urlBase };
}

return {
...p,
passthroughFileCopy: true,
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ concurrency:
group: "pages"
cancel-in-progress: true

env:
NODE_ENV: build
BASE_URL: ${{ github.event.repository.name }}

jobs:
# Single deploy job since we're just deploying
build-and-deploy:
Expand Down

0 comments on commit 36398b3

Please sign in to comment.