Skip to content

Commit 5444eb2

Browse files
committed
Run deploy in base branch context
1 parent 02ebd62 commit 5444eb2

File tree

2 files changed

+14
-30
lines changed

2 files changed

+14
-30
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Build
22

3-
on:
4-
workflow_call:
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
58

69
jobs:
710
build:

.github/workflows/deploy-prod.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
11
name: Deploy
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
3+
on:
4+
workflow_run:
5+
workflows: [build]
6+
types:
7+
- completed
88

99
jobs:
10-
build:
11-
uses: ./.github/workflows/build.yml
12-
secrets: inherit
13-
1410
deploy_live_website:
1511
runs-on: ubuntu-latest
16-
needs: build
1712
if: github.event_name == 'push'
1813
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
2214
- name: Download pages
2315
uses: actions/download-artifact@v4
2416
with:
17+
run-id: ${{ github.event.workflow_run.id }}
2518
name: page-build
2619
path: public
2720

28-
- name: Get PR information
29-
uses: potiuk/get-workflow-origin@751d47254ef9e8b5eef955e24e79305233702781
30-
id: source-run-info
31-
with:
32-
token: ${{ secrets.GITHUB_TOKEN }}
33-
sourceRunId: ${{ github.event.workflow_run.id }}
34-
3521
- name: change URLs for large files
3622
shell: bash
3723
run: |
@@ -49,19 +35,14 @@ jobs:
4935

5036
- uses: FirebaseExtended/action-hosting-deploy@v0
5137
id: firebase-deploy
52-
if: env.FIREBASE_SERVICE_ACCOUNT
53-
env:
54-
LIVE_NAME: "live"
55-
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
5638
with:
57-
repoToken: "${{ secrets.GITHUB_TOKEN }}"
58-
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
39+
repoToken: ${{ secrets.GITHUB_TOKEN }}
40+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
5941
projectId: cp-algorithms
60-
channelId: ${{ env.LIVE_NAME }}
42+
channelId: live
6143

6244
deploy_github_pages:
6345
runs-on: ubuntu-latest
64-
needs: build
6546
steps:
6647
- name: Checkout repository
6748
uses: actions/checkout@v3

0 commit comments

Comments
 (0)