@@ -2,7 +2,7 @@ name: "Deploy Preview"
2
2
3
3
on :
4
4
pull_request_target :
5
- branches : [main, v3.0.0, v2.0.0 ]
5
+ branches : [main]
6
6
7
7
jobs :
8
8
precheck :
@@ -130,6 +130,7 @@ jobs:
130
130
contents : read
131
131
pull-requests : write
132
132
checks : write
133
+ id-token : write # <-- 1. ADDED PERMISSION
133
134
outputs :
134
135
preview_url : ${{ steps.deploy_preview.outputs.details_url }}
135
136
@@ -143,19 +144,26 @@ jobs:
143
144
node-version : " 20"
144
145
cache : " yarn"
145
146
146
- - uses : actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
147
+ # 2. ADDED AUTHENTICATION STEP
148
+ - name : Authenticate to Google Cloud
149
+ uses : google-github-actions/auth@v2
150
+ with :
151
+ workload_identity_provider : ${{ secrets.WIF_PROVIDER }}
152
+ service_account : ${{ secrets.WIF_SERVICE_ACCOUNT }}
153
+
154
+ - uses : actions/download-artifact@95815c8cf2ff2164869cbab79da8d1f422bc89e # v4
147
155
with :
148
156
name : build
149
157
150
158
- name : Unzip build artifact
151
159
run : unzip build.zip
152
160
161
+ # 3. MODIFIED DEPLOYMENT STEP
153
162
- name : Deploy to Firebase
154
163
id : deploy_preview
155
164
uses : FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9.0
156
165
with :
157
166
repoToken : " ${{ secrets.GITHUB_TOKEN }}"
158
- firebaseServiceAccount : " ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PANDEV }}"
159
167
projectId : pandev
160
168
expires : 30d
161
169
channelId : " pr${{ github.event.number }}"
@@ -199,28 +207,3 @@ jobs:
199
207
with :
200
208
name : visual_diffs
201
209
path : visual_diffs
202
-
203
- # - name: Comment PR with results
204
- # if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
205
- # uses: actions/github-script@v7
206
- # with:
207
- # github-token: ${{ secrets.GITHUB_TOKEN }}
208
- # script: |
209
- # const fs = require('fs');
210
- # const results = JSON.parse(fs.readFileSync('visual_diffs/results.json', 'utf8'));
211
- # const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
212
- # let body = `### Visual Diff Summary\n\n[View Logs](${runUrl})\n\n`;
213
- # body += `Total: ${results.summary.total}, Matches: ${results.summary.matches}, Diffs: ${results.summary.mismatches}, Skipped: ${results.summary.skipped}\n\n`;
214
- # if (results.pages.length) {
215
- # body += '| Page | Status |\n| --- | --- |\n';
216
- # for (const p of results.pages) {
217
- # if (p.status !== 'match') {
218
- # body += `| ${p.path} | ${p.status} |\n`;
219
- # }
220
- # }
221
- # }
222
- # await github.rest.issues.createComment({
223
- # ...context.repo,
224
- # issue_number: context.issue.number,
225
- # body
226
- # });
0 commit comments