diff --git a/.github/workflows/lighthouseci.yml b/.github/workflows/lighthouseci.yml index 517e40aac5a2..280fe46d8c3c 100644 --- a/.github/workflows/lighthouseci.yml +++ b/.github/workflows/lighthouseci.yml @@ -15,5 +15,5 @@ jobs: with: node-version: 19 - run: npm install && npm install -g @lhci/cli@0.11.x - - run: npm run build + - run: CI=false npm run build - run: lhci autorun diff --git a/.lighthouserc.js b/.lighthouserc.js index 8c29afbbe69b..06bc8b98b5c9 100644 --- a/.lighthouserc.js +++ b/.lighthouserc.js @@ -2,31 +2,34 @@ module.exports = { "ci": { "collect": { "staticDistDir": "./public", - "url" : ["http://localhost/404.html", - "http://localhost/index.html", - "http://localhost/404/index.html", - "http://localhost/company/about.html" , - "http://localhost/cloud-native-management/meshery.html", - "http://localhost/cloud-native-management/meshmap.html", - "http://localhost/learn/learning-paths.html", - "http://localhost/learn/service-mesh-books.html", - "http://localhost/learn/service-mesh-workshops.html", - "http://localhost/learn.html", - "http://localhost/blog.html", - "http://localhost/resources.html", - "http://localhost/careers.html", - "http://localhost/community/members.html", - "http://localhost/community/meshmates.html", - "http://localhost/community/events.html", - "http://localhost/community/newcomers.html",], + "url" : [ + "http://localhost/404.html", + "http://localhost/404/index.html", + "http://localhost", + "http://localhost/company/about/index.html", + "http://localhost/cloud-native-management/meshery/index.html", + "http://localhost/cloud-native-management/meshmap/index.html", + "http://localhost/learn/learning-paths/index.html", + "http://localhost/learn/service-mesh-books/index.html", + "http://localhost/learn/service-mesh-workshops/index.html", + "http://localhost/learn/index.html", + "http://localhost/blog/index.html", + "http://localhost/resources/index.html", + "http://localhost/careers/index.html", + "http://localhost/community/members/index.html", + "http://localhost/community/meshmates/index.html", + "http://localhost/community/events/index.html", + "http://localhost/community/newcomers/index.html", + ], }, "assert": { - "preset": "lighthouse:no-pwa", "assertions": { - "csp-xss": "off", - "aria-hidden-focus": "off" - } - }, + "categories:performance": ["warn", {"minScore": .90}], + "categories:accessibility": ["warn", {"minScore": .90}], + "categories:best-practices": ["warn", {"minScore": .90}], + "categories:seo": ["warn", {"minScore": .90}], + } + }, "upload": { "target": "temporary-public-storage", }, diff --git a/gatsby-node.js b/gatsby-node.js index aeade5cbd294..f2e871fa9208 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -11,7 +11,7 @@ const { paginate } = require("gatsby-awesome-pagination"); const { createFilePath } = require("gatsby-source-filesystem"); const config = require("./gatsby-config"); -if (process.env.CI) { +if (process.env.CI === "true") { // All process.env.CI conditionals in this file are in place for GitHub Pages, if webhost changes in the future, code may need to be modified or removed. //Replacing '/' would result in empty string which is invalid const replacePath = (url) => (url === "/" || url.includes("/404")) ? url : `${url}.html`; @@ -69,7 +69,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => { const { createPage } = actions; const envCreatePage = (props) => { - if (process.env.CI){ + if (process.env.CI === "true"){ const { path, ...rest } = props; createRedirect({ fromPath: `/${path}/`, toPath: `/${path}`, redirectInBrowser: true, isPermanent: true });