Skip to content

Commit

Permalink
Merge pull request #2589 from aiidtest/fix-test-production
Browse files Browse the repository at this point in the history
Use production context to make sure migrations and translations run first
  • Loading branch information
kepae authored Jan 25, 2024
2 parents e8406ef + d181605 commit df5288c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: npm install netlify-cli -g

- name: Build using Netlify
run: netlify build --context ${{ inputs.context }} --offline
run: netlify build --context ${{ inputs.netlify-context }} --offline
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
sha: ${{ github.event.pull_request.head.sha }}
environment: staging
netlify-context: deploy-preview

call-test:
if: ${{ !failure() }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
sha: ${{ github.sha }}
environment: staging
netlify-context: production

call-test:
uses: ./.github/workflows/test.yml
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: 'The SHA of the commit to build'
type: string
required: true
netlify-context:
description: The Netlify context use when building
type: string
required: true

jobs:
test:
Expand Down Expand Up @@ -51,7 +55,7 @@ jobs:
run: npm install netlify-cli -g

- name: Build using Netlify
run: netlify build --context deploy-preview --offline
run: netlify build --context ${{ inputs.netlify-context }} --offline
working-directory: site/gatsby-site
env:
INSTRUMENT: true
Expand Down
9 changes: 5 additions & 4 deletions site/gatsby-site/tests-netlify.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[build]
base = "/site/gatsby-site"
publish = "public"

[[plugins]]
package = "@netlify/plugin-gatsby"

[build.processing.html]
pretty_urls = false

[context.deploy-preview]
publish = "public/"
pretty_urls = false

0 comments on commit df5288c

Please sign in to comment.