Skip to content

Commit

Permalink
Merge pull request #418 from frontendnetwork/staging
Browse files Browse the repository at this point in the history
Staging → Main
  • Loading branch information
philipbrembeck authored Aug 15, 2023
2 parents b767543 + c4ff184 commit 3c754af
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_STAGING=true
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_STAGING=false
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Setup Production Env
run: cp .env.production .env

- name: Build and push Docker image
uses: docker/build-push-action@56932deb0a0db9d23e245320b1e45fec46b8d66f
with:
Expand Down Expand Up @@ -79,6 +82,9 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Setup Staging Env
run: cp .env.development .env

- name: Build and push Docker image
uses: docker/build-push-action@56932deb0a0db9d23e245320b1e45fec46b8d66f
with:
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@ericblade/quagga2": "^1.8.2",
"@frontendnetwork/vegancheck": "1.1.26",
"@frontendnetwork/vegancheck": "^1.1.31",
"@socialgouv/matomo-next": "^1.6.1",
"@types/node": "20.4.5",
"@types/react-dom": "18.2.7",
Expand Down
3 changes: 2 additions & 1 deletion src/components/check.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const ProductSearch: React.FC = () => {

setLoading(true);
try {
const data = await VeganCheck.getProductByBarcode(barcode);
console.warn(process.env.NEXT_PUBLIC_STAGING);
const data = await VeganCheck.getProductByBarcode(barcode, process.env.NEXT_PUBLIC_STAGING === "true" ? true : false);
setLoading(false);
if (data.status === 200) {
setResult(data.product);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ingredientscheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const IngredientsCheck = () => {
const checkIngredients = async () => {
setLoading(true);
try {
const data = await VeganCheck.checkIngredientsList(ingredients.value);
const data = await VeganCheck.checkIngredientsList(ingredients.value, process.env.NEXT_PUBLIC_STAGING === "true" ? true : false);
if (data.data.vegan === "false") {
setVegan(false);
setFlagged(data.data.flagged);
Expand Down

0 comments on commit 3c754af

Please sign in to comment.