Skip to content

Commit 6e6c349

Browse files
authored
Merge pull request #28 from ProLoser/copilot/add-google-token
2 parents a5c8491 + be4b87b commit 6e6c349

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
APIFY_TOKEN=apify_api_1234567890
1+
APIFY_TOKEN=apify_api_1234567890
2+
GOOGLE_TOKEN=your_google_maps_api_key_here

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v4
2626

27-
- name: Inject APIFY_TOKEN into map.js
27+
- name: Inject tokens
2828
env:
2929
APIFY_TOKEN: ${{ secrets.APIFY_TOKEN }}
30+
GOOGLE_TOKEN: ${{ secrets.GOOGLE_TOKEN }}
3031
run: |
3132
sed -i "s/__APIFY_TOKEN__/${APIFY_TOKEN}/g" map.js
33+
sed -i "s/__GOOGLE_TOKEN__/${GOOGLE_TOKEN}/g" index.html
3234
3335
- name: Setup Pages
3436
uses: actions/configure-pages@v4

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ Latest version has a button to quickly add events to your calendar of choice
1717
cp .env.example .env
1818
```
1919

20-
2. Add your Apify API token to `.env`:
20+
2. Add your Apify API token and Google Maps API key to `.env`:
2121
```
2222
APIFY_TOKEN=your_actual_apify_token_here
23+
GOOGLE_TOKEN=your_actual_google_maps_api_key_here
2324
```
2425

2526
3. Open `index.html` in your browser directly, or use a local server:
@@ -33,15 +34,16 @@ Latest version has a button to quickly add events to your calendar of choice
3334

3435
The site automatically deploys to GitHub Pages when you push to the `gh-pages` branch.
3536

36-
**Required GitHub Secret:**
37+
**Required GitHub Secrets:**
3738

38-
You need to add your Apify API token as a GitHub secret:
39+
You need to add your Apify API token and Google Maps API key as GitHub secrets:
3940

4041
1. Go to your repository on GitHub
4142
2. Navigate to **Settings****Secrets and variables****Actions**
4243
3. Click **New repository secret**
43-
4. Name: `APIFY_TOKEN`
44-
5. Value: Your Apify API token
45-
6. Click **Add secret**
44+
4. Add the following secrets:
45+
- Name: `APIFY_TOKEN`, Value: Your Apify API token
46+
- Name: `GOOGLE_TOKEN`, Value: Your Google Maps API key
47+
5. Click **Add secret** for each
4648

47-
The GitHub Actions workflow will automatically inject this token into the JavaScript file at build time.
49+
The GitHub Actions workflow will automatically inject these tokens into the JavaScript files at build time.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h2>Showing <output name="countEvents" for="date">0</output> Events</h2>
7272
</form>
7373
<script async defer src="https://cdn.jsdelivr.net/npm/add-to-calendar-button@2"></script>
7474
<script src="map.js"></script>
75-
<script async src="https://maps.googleapis.com/maps/api/js?v=3.exp&loading=async&key=AIzaSyA6u8cQEcT8e94ZGBdbdWkC17aUP1etCos&libraries=marker&callback=initialize"></script>
75+
<script async src="https://maps.googleapis.com/maps/api/js?v=3.exp&loading=async&key=__GOOGLE_TOKEN__&libraries=marker&callback=initialize"></script>
7676

7777
<!-- Google tag (gtag.js) -->
7878
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0NECRETGYD"></script>

0 commit comments

Comments
 (0)