Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/staging-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
echo GTAG_TRACKING_ID_FOR_GA4=${{ secrets.STAGING_GTAG_TRACKING_ID_FOR_GA4 }} >> .env
echo GTAG_TRACKING_ID_FOR_GTAG=${{ secrets.STAGING_GTAG_TRACKING_ID_FOR_GTAG }} >> .env
cat .env
- name: Set environment
run : sed -i 's/localhost/website.testsigma.com/g' src/environment.ts
- name: Build
run: |
PREFIX_PATHS=true npm run build && npm run deploy
Expand Down
6 changes: 6 additions & 0 deletions src/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const environment = {
hostname: "localhost",
isStaging() {
return this.hostname == "website.testsigma.com";
}
}
7 changes: 6 additions & 1 deletion src/templates/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Link} from "../../.cache/gatsby-browser-entry";
import SearchInputBox from "../components/SearchInputBox";
import MobileView from "../components/MobileView";
import Footer from "../components/Footer"
import {environment} from "../environment";

export default ({ data, pageContext }) => {

Expand All @@ -35,6 +36,10 @@ export default ({ data, pageContext }) => {
contextualLinks = <SideBar links={post.frontmatter.contextual_links} />;
}

if(environment.isStaging()) {
post.frontmatter.noindex = true;
}

return (
<Layout>
<SEO
Expand Down Expand Up @@ -190,4 +195,4 @@ export const query = graphql`
}
}
`;
/* eslint-enaable */
/* eslint-enaable */