Skip to content

Update dist folder (#254) #146

Update dist folder (#254)

Update dist folder (#254) #146

Workflow file for this run

# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
if: github.event.commits[0].message != 'Update dist folder'
permissions:
contents: write
id-token: write
env:
GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}"
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.GH_MERGE_TOKEN }}
fetch-depth: 0
- name: Set Git Identity
run: |
git config --global user.name 'googlemaps-bot'
git config --global user.email '[email protected]'
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node
- uses: actions/setup-node@v3
with:
node-version: '22.x'
- run: npm i
- run: npm run build-all
- uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }}
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Deploy to Firebase Hosting
run: firebase deploy --only hosting
- name: Close Existing PRs (temp-build-branch to main)
run: |
EXISTING_PR=$(gh pr list --base main --head temp-build-branch --state open --json number -q '.[].number')
if [[ -n "$EXISTING_PR" ]]; then
echo "Found existing open PR(s) for temp-build-branch to main: $EXISTING_PR"
gh pr close "$EXISTING_PR"
fi
env:
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
- name: Create temporary branch
run: git checkout -b temp-build-branch
- name: Commit and Push Changes (to temp branch)
run: |
git add dist index.html
git commit -m "Update dist folder"
git push --force origin temp-build-branch