-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from Linaro/staging
Add pull request support
- Loading branch information
Showing
2 changed files
with
54 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,22 @@ | ||
name: ClosePullRequestAction | ||
|
||
on: | ||
pull_request_target: | ||
types: [closed] | ||
branches: [ main ] | ||
|
||
jobs: | ||
close: | ||
runs-on: self-hosted | ||
steps: | ||
- name: close pull request | ||
run: | | ||
PR_NUMBER=$(jq -r ".pull_request.number" $GITHUB_EVENT_PATH) | ||
echo "Cleaning up after $PR_NUMBER has closed" | ||
BUILDDIR="/srv/websitepreview/$AWS_STATIC_SITE_URL-$PR_NUMBER" | ||
if [ -d "$BUILDDIR" ]; then | ||
echo "Removing website review directory" | ||
rm -rf "$BUILDDIR" | ||
else | ||
echo "No website review directory ($BUILDDIR) to remove" | ||
fi |
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,32 @@ | ||
name: PullRequestAction | ||
|
||
on: | ||
pull_request_target: | ||
branches: [ main ] | ||
|
||
# Cancel in-progress jobs or runs for the current pull request | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
process-pull-request: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Fetch git repository | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
fetch-depth: "0" | ||
|
||
- name: Initialise status | ||
run: /srv/github-action-scripts/init-deploy-preview.sh | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Merge test branch | ||
uses: linaro-its/merge-test-branch@v2.7 | ||
|
||
- name: Build site | ||
run: /srv/github-action-scripts/build-astro-site.sh | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} |