Skip to content

Commit 1b90c83

Browse files
committed
Add workflow to trigger build on WooPay changes
1 parent 598dc89 commit 1b90c83

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Build zip file on WooPay changes"
2+
3+
# This action will run on PRs and monitor changes in specific directories
4+
on:
5+
pull_request:
6+
paths:
7+
- 'client/checkout/woopay/**'
8+
- 'client/components/woopay/**'
9+
- 'includes/woopay/**'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-zip:
14+
name: "Build the zip file"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: "Checkout repository"
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: "Set up repository"
23+
uses: ./.github/actions/setup-repo
24+
25+
- name: "Build the plugin"
26+
id: build_plugin
27+
uses: ./.github/actions/build
28+
29+
- name: "Upload the zip file as an artifact"
30+
id: upload_artifact
31+
uses: actions/upload-artifact@v4
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
name: "woocommerce-payments"
36+
path: release
37+
retention-days: 14
38+
39+
- name: "Echo artifact ID"
40+
run: |
41+
echo "Build artifact ID: ${{ steps.upload_artifact.outputs.artifact_id }}"
42+
43+
- name: "Post artifact ID as a PR comment"
44+
if: ${{ github.event_name == 'pull_request' }}
45+
run: |
46+
COMMENT=":package: Build artifact ID: ${{ steps.upload_artifact.outputs.artifact_id }}"
47+
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT"
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+

0 commit comments

Comments
 (0)