|
1 | | - # Copyright 2025 Google LLC |
| 1 | +# Copyright 2025 Google LLC |
2 | 2 | # |
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | # you may not use this file except in compliance with the License. |
|
15 | 15 | name: Release |
16 | 16 |
|
17 | 17 | on: |
18 | | - release: |
19 | | - types: [published] |
| 18 | + pull_request: |
| 19 | + types: [closed] |
| 20 | + branches: [main] |
20 | 21 | jobs: |
21 | | - release: |
22 | | - runs-on: ubuntu-latest |
23 | | - permissions: |
24 | | - contents: read |
25 | | - id-token: write |
26 | | - env: |
27 | | - GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}" |
28 | | - steps: |
29 | | - - uses: actions/checkout@v3 |
30 | | - with: |
31 | | - token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} |
32 | | - - uses: actions/cache@v3 |
33 | | - with: |
34 | | - path: ~/.npm |
35 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
36 | | - restore-keys: | |
37 | | - ${{ runner.os }}-node |
38 | | - - uses: actions/setup-node@v3 |
39 | | - with: |
40 | | - node-version: '22.x' |
41 | | - - run: npm i |
42 | | - - run: npm run build-prod |
| 22 | + release: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: |
| 25 | + contents: read |
| 26 | + id-token: write |
| 27 | + if: github.event.pull_request.merged == true |
| 28 | + env: |
| 29 | + GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}" |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v3 |
| 32 | + with: |
| 33 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + - uses: actions/cache@v3 |
| 35 | + with: |
| 36 | + path: ~/.npm |
| 37 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 38 | + restore-keys: | |
| 39 | + ${{ runner.os }}-node |
| 40 | + - uses: actions/setup-node@v3 |
| 41 | + with: |
| 42 | + node-version: '22.x' |
| 43 | + - run: npm i |
| 44 | + - run: npm run build-prod |
43 | 45 |
|
44 | | - - uses: google-github-actions/auth@v1 |
45 | | - with: |
46 | | - credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }} |
| 46 | + - uses: google-github-actions/auth@v1 |
| 47 | + with: |
| 48 | + credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }} |
47 | 49 |
|
48 | | - - name: Install Firebase CLI |
49 | | - run: npm install -g firebase-tools |
| 50 | + - name: Install Firebase CLI |
| 51 | + run: npm install -g firebase-tools |
50 | 52 |
|
51 | | - - name: Deploy to Firebase Hosting |
52 | | - run: firebase deploy --only hosting |
| 53 | + - name: Deploy to Firebase Hosting |
| 54 | + run: firebase deploy --only hosting |
0 commit comments