-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to trigger build on WooPay changes
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "Build zip file on WooPay changes" | ||
|
||
# This action will run on PRs and monitor changes in specific directories | ||
on: | ||
pull_request: | ||
paths: | ||
- 'client/checkout/woopay/**' | ||
- 'client/components/woopay/**' | ||
- 'includes/woopay/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-zip: | ||
name: "Build the zip file" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: "Set up repository" | ||
uses: ./.github/actions/setup-repo | ||
|
||
- name: "Build the plugin" | ||
id: build_plugin | ||
uses: ./.github/actions/build | ||
|
||
- name: "Upload the zip file as an artifact" | ||
id: upload_artifact | ||
uses: actions/upload-artifact@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: "woocommerce-payments" | ||
path: release | ||
retention-days: 14 | ||
|
||
- name: "Echo artifact ID" | ||
run: | | ||
echo "Build artifact ID: ${{ steps.upload_artifact.outputs.artifact_id }}" | ||
- name: "Post artifact ID as a PR comment" | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
COMMENT=":package: Build artifact ID: ${{ steps.upload_artifact.outputs.artifact_id }}" | ||
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|