Skip to content

Commit 965bc5a

Browse files
authored
Merge pull request #6 from sysprog21/refine-cicd
CI: Add PR trigger and refine deployment conditionals
2 parents 6b17810 + e2b8542 commit 965bc5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build and Deploy
33
on:
44
push:
55
branches: [main]
6+
pull_request:
7+
branches: [main]
68
workflow_dispatch:
79

810
permissions:
@@ -11,7 +13,7 @@ permissions:
1113
id-token: write
1214

1315
concurrency:
14-
group: "pages"
16+
group: ${{ github.workflow }}-${{ github.ref }}
1517
cancel-in-progress: true
1618

1719
jobs:
@@ -56,16 +58,19 @@ jobs:
5658
run: make wasm
5759

5860
- name: Setup Pages
61+
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
5962
uses: actions/configure-pages@v5
6063
with:
6164
enablement: true
6265

6366
- name: Upload artifact
67+
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
6468
uses: actions/upload-pages-artifact@v4
6569
with:
6670
path: 'web'
6771

6872
deploy:
73+
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
6974
environment:
7075
name: github-pages
7176
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)