From f9bda3a0afce6927b7e10ae9df6e21693dd1fd0d Mon Sep 17 00:00:00 2001 From: petr-hajek Date: Thu, 19 Sep 2024 14:31:09 +0200 Subject: [PATCH] make API key env var --- .github/workflows/main.yml | 2 ++ .gitignore | 3 ++- src/config.js | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89f3acd..ea09a76 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,8 @@ jobs: - name: Install dependencies run: npm ci - name: Build + env: + VITE_MAPTILER_API_KEY: ${{ secrets.MAPTILER_API_KEY }} run: npm run build - name: Deploy diff --git a/.gitignore b/.gitignore index 40b878d..39024ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules/ \ No newline at end of file +node_modules/ +.env.local \ No newline at end of file diff --git a/src/config.js b/src/config.js index 82212fa..7244f29 100644 --- a/src/config.js +++ b/src/config.js @@ -1,4 +1,4 @@ export default { - // Replace with YOUR_MAPTILER_API_KEY - this key is restricted to MapTiler Documentation pages. - MAPTILER_API_KEY: "qC6zBtR7VUaKtyyiLcJq", + // Replace with YOUR MAPTILER API KEY + MAPTILER_API_KEY: import.meta.env.VITE_MAPTILER_API_KEY, };