Skip to content

Commit

Permalink
Trying yaml approach
Browse files Browse the repository at this point in the history
  • Loading branch information
akirosingh committed Dec 12, 2023
1 parent 1ab6019 commit 369f598
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
35 changes: 35 additions & 0 deletions deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main # Set your default branch here

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14' # Set your Node.js version here

- name: Install Dependencies
run: npm install

- name: Inject API Key
run: sed -i 's/YOUR_API_KEY_PLACEHOLDER/${{ secrets.GOOGLE_API_KEY }}/' path/to/your/file.js

- name: Build
run: npm run build # Replace with your build command

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
token: ${{ secrets.GITHUB_TOKEN }} # GitHub automatically creates this secret to use in your workflow.
7 changes: 1 addition & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
}
</style>
</head>
<script id="googleMapsScript" async defer></script>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_PLACEHOLDER&callback=initMap" async defer></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var script = document.getElementById("googleMapsScript");
script.src = `https://maps.googleapis.com/maps/api/js?key=${process.env.GOOGLE_API_KEY}&callback=initMap`;
});

let map;

function getMarkerIcon(boardType) {
Expand Down

0 comments on commit 369f598

Please sign in to comment.