From 8a731701d3b7418303cf8dfa6a257e80fd31ba01 Mon Sep 17 00:00:00 2001 From: Joshua Date: Sun, 1 Mar 2020 13:43:17 -0800 Subject: [PATCH 1/3] added pinUrl --- src/redux/rootSaga.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redux/rootSaga.js b/src/redux/rootSaga.js index a39f92139..4e70ab2d3 100644 --- a/src/redux/rootSaga.js +++ b/src/redux/rootSaga.js @@ -11,6 +11,7 @@ import { getDataFailure, } from './reducers/data'; +const pinUrl = `${process.env.DB_URL}/pins`; const getState = (state, slice) => state[slice]; function* getData() { @@ -29,7 +30,7 @@ function* getData() { }; try { - const response = yield call(axios.post, process.env.DB_URL, options); + const response = yield call(axios.post, pinUrl, options); const { data } = response; yield put(getDataSuccess(data)); } catch (e) { From 86454eb6eabb13c412044d614fe8ab04db58fc1d Mon Sep 17 00:00:00 2001 From: Joshua Date: Sun, 1 Mar 2020 13:46:38 -0800 Subject: [PATCH 2/3] URL works --- src/redux/rootSaga.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redux/rootSaga.js b/src/redux/rootSaga.js index 4e70ab2d3..e944b67a3 100644 --- a/src/redux/rootSaga.js +++ b/src/redux/rootSaga.js @@ -11,7 +11,7 @@ import { getDataFailure, } from './reducers/data'; -const pinUrl = `${process.env.DB_URL}/pins`; +const pinUrl = `http://${process.env.DB_URL}/pins`; const getState = (state, slice) => state[slice]; function* getData() { From e2ad8db1331b2f7494a50f64ab6899ea77990dd3 Mon Sep 17 00:00:00 2001 From: sellnat77 Date: Sun, 1 Mar 2020 13:46:42 -0800 Subject: [PATCH 3/3] Added environment variable connection for workflows --- .github/workflows/Continuous_Delivery.yml | 3 ++- .github/workflows/Continuous_Integration_Frontend.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Continuous_Delivery.yml b/.github/workflows/Continuous_Delivery.yml index 75b0941c4..539ed62c9 100644 --- a/.github/workflows/Continuous_Delivery.yml +++ b/.github/workflows/Continuous_Delivery.yml @@ -24,6 +24,7 @@ jobs: run: export CI=true && npm run test -- --coverage env: MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} + DB_URL: ${{ secrets.DB_URL }} # DISABLING DEPLOYMENT TO PRESERVE "PRODUCTION" - name: Deploy to GH pages uses: JamesIves/github-pages-deploy-action@master @@ -32,4 +33,4 @@ jobs: BASE_BRANCH: master # The branch the action should deploy from. BRANCH: gh-pages # The branch the action should deploy to. FOLDER: dist # The folder the action should deploy. - BUILD_SCRIPT: echo REACT_APP_MAPBOX_TOKEN=${{secrets.MAPBOX_TOKEN}} > .env && npm rebuild node-sass && npm install && npm run-script build # The build script the action should run prior to deploying. + BUILD_SCRIPT: echo REACT_APP_MAPBOX_TOKEN=${{secrets.MAPBOX_TOKEN}} && echo DB_URL=${{secrets.DB_URL}} > .env && npm rebuild node-sass && npm install && npm run-script build # The build script the action should run prior to deploying. diff --git a/.github/workflows/Continuous_Integration_Frontend.yml b/.github/workflows/Continuous_Integration_Frontend.yml index c5a65625a..ef5f8a3ee 100644 --- a/.github/workflows/Continuous_Integration_Frontend.yml +++ b/.github/workflows/Continuous_Integration_Frontend.yml @@ -23,3 +23,4 @@ jobs: run: npm run test -- --coverage env: MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} + DB_URL: ${{ secrets.DB_URL }}