Skip to content

Commit a1e4d0d

Browse files
authored
Merge pull request #85 from phillycommunitywireless/secret-api
Move Mapbox access token to Github actions repository secret
2 parents a7da4a3 + 7f7c186 commit a1e4d0d

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/jekyll-gh-pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/configure-pages@v5
3333
- name: Build with Jekyll
3434
uses: actions/jekyll-build-pages@v1
35+
env:
36+
MAPBOX_API: ${{ secrets.MAPBOX_API }}
3537
with:
3638
source: ./
3739
destination: ./_site

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MAPBOX_API:

dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# from my digging the github action uses jekyll 3.9.5 but that doesn't exist on dhub...
22
# https://github.com/jekyll/jekyll/issues/9066 - issue with webrick gem - downgrade version
33
FROM jekyll/jekyll:3.8.5
4-
CMD jekyll serve --force_polling --drafts
4+
CMD jekyll serve --force_polling --drafts --config _config.yml

js/map-init.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
---
2+
---
13
import { toggleSidebar } from './bind-elements.js';
24
import testMobile from './util/test-mobile.util.js';
35

4-
mapboxgl.accessToken =
5-
'pk.eyJ1IjoiZm12YWxkZXpnODQiLCJhIjoiY2xqajJzZXZ2MDU3ZTNybHBrdHo4OWo4aSJ9.ENnejUYGtJT-74gG0opSQA';
6+
// Get current env and load mapbox key
7+
const MAPBOX_API = "{{ site.MAPBOX_API }}"
8+
mapboxgl.accessToken = MAPBOX_API;
69

710
// Default values for map center and zoom
811
// Set distinct map center/zoom via query parameter

0 commit comments

Comments
 (0)