Skip to content

Commit

Permalink
deployment staging - env patch
Browse files Browse the repository at this point in the history
  • Loading branch information
KarolNet committed Nov 17, 2023
1 parent 57285f8 commit 9331a30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ jobs:
rm -rf public/blog
mkdir -p public/blog
find public/ -maxdepth 1 -mindepth 1 -not -name blog -exec mv '{}' public/blog/ \;
# find public/blog -name index.html -exec sed -i 's\window.pagePath="\window.pagePath="/blog\g' {} \;
env:
PATH_PREFIX ${{PATH_PREFIX}}
- name: Cloudflare
run: |
npm install -g @cloudflare/wrangler
Expand Down
6 changes: 3 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ require('dotenv').config({
});

module.exports = {
pathPrefix: '/staging-blog',
pathPrefix: process.env.PATH_PREFIX,
siteMetadata: {
title: 'Flotiq',
description: 'Effortless headless CMS',
siteUrl: 'https://flotiq.com', // full path to blog - no ending slash
apiKey: process.env.SCOPED_FLOTIQ_API_KEY,
pathPrefix: process.env.NODE_ENV === 'production' ? '/staging-blog' : '',
pathPrefix: process.env.NODE_ENV === 'production' ? process.env.PATH_PREFIX : '',
},
plugins: [
'gatsby-plugin-sass',
Expand Down Expand Up @@ -66,7 +66,7 @@ module.exports = {
resolve: 'gatsby-plugin-robots-txt',
options: {
host: 'https://flotiq.com',
sitemap: 'https://flotiq.com/staging-blog/sitemap.xml',
sitemap: `https://flotiq.com${process.env.PATH_PREFIX}/sitemap.xml`,
policy: [{ userAgent: '*', allow: '/' }],
},
},
Expand Down

0 comments on commit 9331a30

Please sign in to comment.