diff --git a/.github/workflows/Continuous_Delivery.yml b/.github/workflows/Continuous_Delivery.yml index 62a76f5c2..0e8ca9c15 100644 --- a/.github/workflows/Continuous_Delivery.yml +++ b/.github/workflows/Continuous_Delivery.yml @@ -22,3 +22,11 @@ jobs: run: npm run-script build - name: Run Tests run: export CI=true && npm run test -- --coverage + env: + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} + - name: Deploy + run: npm run deploy + env: + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + diff --git a/.github/workflows/Continuous_Integration.yml b/.github/workflows/Continuous_Integration.yml index 847a2ccd1..a49bf29d2 100644 --- a/.github/workflows/Continuous_Integration.yml +++ b/.github/workflows/Continuous_Integration.yml @@ -17,8 +17,10 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Install Packages - run: npm install && echo $TEST_SECRET + run: npm install - name: Build project run: npm run-script build - name: Run Tests run: export CI=true && npm run test -- --coverage + env: + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} diff --git a/src/components/PinMap/PinMap.jsx b/src/components/PinMap/PinMap.jsx index c7722f379..55cbacb8c 100644 --- a/src/components/PinMap/PinMap.jsx +++ b/src/components/PinMap/PinMap.jsx @@ -1,15 +1,12 @@ import React, { Component } from 'react'; import { Map, Marker, Popup, TileLayer, Rectangle, Tooltip } from 'react-leaflet'; import Choropleth from 'react-leaflet-choropleth'; -// import { mapToken } from '../../config.js'; import { getDataResources } from '../../Util/DataService.js'; import neighborhoodOverlay from '../../data/la-county-neighborhoods-v6.json'; import municipalOverlay from '../../data/la-county-municipal-regions-current.json'; import councilDistrictsOverlay from '../../data/la-city-council-districts-2012.json'; import axios from 'axios'; -const DONT_LOOK_AT_THIS = 'pk.eyJ1Ijoiam9zaHVhbWFyeCIsImEiOiJjazFpb3RwcW8wYXM2M2Nud29zMWhjcnZ4In0.Rg9UY0SSJqCIPp275kRcUg'; - const serviceRequests = [ 'Bulky Items', 'Dead Animal Removal', @@ -59,14 +56,12 @@ class PinMap extends Component { request: serviceRequests[0], position: [34.0173157, -118.2497254], zoom: 10, - mapUrl: `https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=${DONT_LOOK_AT_THIS}`, + mapUrl: `https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=${process.env.MAPBOX_TOKEN}`, dataUrl: 'https://data.lacity.org/resource/h65r-yf5i.json?$select=location,zipcode,address,requesttype,status,ncname,streetname,housenumber&$where=date_extract_m(CreatedDate)+between+2+and+3', geoJSON: councilDistrictsOverlay, showMarkers: false, bounds: null, }; - - console.log(process.env) } componentDidMount() {