@@ -2,7 +2,7 @@ name: "Deploy Preview"
22
33on :
44 pull_request_target :
5- branches : [main, v3.0.0, v2.0.0 ]
5+ branches : [main]
66
77jobs :
88 precheck :
@@ -130,6 +130,7 @@ jobs:
130130 contents : read
131131 pull-requests : write
132132 checks : write
133+ id-token : write
133134 outputs :
134135 preview_url : ${{ steps.deploy_preview.outputs.details_url }}
135136
@@ -143,6 +144,16 @@ jobs:
143144 node-version : " 20"
144145 cache : " yarn"
145146
147+ - name : Authenticate to Google Cloud
148+ id : auth
149+ uses : google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
150+ with :
151+ workload_identity_provider : ${{ secrets.WIF_PROVIDER }}
152+ service_account : ${{ secrets.WIF_SERVICE_ACCOUNT }}
153+
154+ - name : Export Google Cloud Credentials
155+ run : echo "GCP_SA_KEY=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
156+
146157 - uses : actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
147158 with :
148159 name : build
@@ -152,10 +163,10 @@ jobs:
152163
153164 - name : Deploy to Firebase
154165 id : deploy_preview
155- uses : FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9 .0
166+ uses : FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10 .0
156167 with :
157168 repoToken : " ${{ secrets.GITHUB_TOKEN }}"
158- firebaseServiceAccount : " ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PANDEV }}"
169+ firebaseServiceAccount : " ${{ env.GCP_SA_KEY }}"
159170 projectId : pandev
160171 expires : 30d
161172 channelId : " pr${{ github.event.number }}"
@@ -199,28 +210,3 @@ jobs:
199210 with :
200211 name : visual_diffs
201212 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