Skip to content

Commit

Permalink
Merge pull request #1075 from EnterpriseDB/fix/evan/stale-cache-worka…
Browse files Browse the repository at this point in the history
…round

Re-enable cache on github builds
  • Loading branch information
epbarger authored Mar 16, 2021
2 parents 102b4b8 + b07c797 commit 750c10b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 21 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/deploy-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:
env:
NODE_ENV: ${{ secrets.NODE_ENV }}

# - name: Checking Gatsby cache
# id: gatsby-cache-build
# uses: actions/cache@v2
# with:
# path: |
# public
# .cache
# key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }}
# restore-keys: |
# ${{ runner.os }}-gatsby-build-develop-
- name: Checking Gatsby cache
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gatsby-build-develop-
- name: Fix mtimes
run: yarn fix-mtimes --force
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:
env:
NODE_ENV: ${{ secrets.NODE_ENV }}

# - name: Checking Gatsby cache
# id: gatsby-cache-build
# uses: actions/cache@v2
# with:
# path: |
# public
# .cache
# key: ${{ runner.os }}-gatsby-build-main-${{ github.run_id }}
# restore-keys: |
# ${{ runner.os }}-gatsby-build-main-
- name: Checking Gatsby cache
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-main-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gatsby-build-main-
- name: Fix mtimes
run: yarn fix-mtimes --force
Expand Down
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module.exports = {
siteUrl: 'https://enterprisedb.com/docs',
algoliaIndex: algoliaIndex,
isDevelopment: !isBuild,
cacheBuster: 2, // for busting gh actions cache if needed
cacheBuster: 1, // for busting gh actions cache if needed
},
plugins: [
'gatsby-plugin-sass',
Expand Down
15 changes: 15 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ const createDoc = (navTree, prevNext, doc, productVersions, actions) => {

const template = doc.frontmatter.productStub ? 'doc-stub.js' : 'doc.js';
const path = isLatest ? replacePathVersion(doc.fields.path) : doc.fields.path;

// workaround for https://github.com/gatsbyjs/gatsby/issues/26520
actions.createPage({
path: path,
component: require.resolve(`./src/templates/${template}`),
context: {},
});

actions.createPage({
path: path,
component: require.resolve(`./src/templates/${template}`),
Expand Down Expand Up @@ -301,6 +309,13 @@ const createAdvocacy = (navTree, prevNext, doc, learn, actions) => {
fileUrlSegment,
)}`;

// workaround for https://github.com/gatsbyjs/gatsby/issues/26520
actions.createPage({
path: doc.fields.path,
component: require.resolve('./src/templates/learn-doc.js'),
context: {},
});

actions.createPage({
path: doc.fields.path,
component: require.resolve('./src/templates/learn-doc.js'),
Expand Down

0 comments on commit 750c10b

Please sign in to comment.