-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
990a45b
commit 7394558
Showing
3 changed files
with
103 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,15 @@ | ||
name: ClosePullRequestAction | ||
|
||
on: | ||
pull_request_target: | ||
types: [closed] | ||
branches: [ main ] | ||
|
||
jobs: | ||
close: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Initialise environment | ||
run: cat "$GITHUB_WORKSPACE/website/.github-env-$GITHUB_BASE_REF" >> $GITHUB_ENV | ||
- name: Clean up | ||
run: /srv/github-action-scripts/close-pr.sh |
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,44 @@ | ||
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@v3 | ||
with: | ||
fetch-depth: 0 | ||
path: website | ||
|
||
- name: Initialise environment | ||
run: cat "$GITHUB_WORKSPACE/website/.github-env-$GITHUB_BASE_REF" >> $GITHUB_ENV | ||
|
||
- name: Initialise status | ||
run: /srv/github-action-scripts/init-deploy-preview.sh | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Merge test branch | ||
uses: linaro-its/[email protected] | ||
with: | ||
path: website | ||
|
||
- name: Build site | ||
run: cd ${{ github.workspace }}/website && /srv/github-action-scripts/build-astro-site.sh | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check links | ||
run: /srv/github-action-scripts/check-links.sh | ||
|
||
- name: Check routing rules | ||
run: /srv/github-action-scripts/test-routing-rules.sh |
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,44 @@ | ||
name: PushAction | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
# Cancel in-progress jobs or runs for the current workflow | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
process-push: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Fetch git repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: website | ||
|
||
- name: Initialise environment | ||
run: cat "$GITHUB_WORKSPACE/website/.github-env-${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
|
||
- name: Build site | ||
run: cd ${{ github.workspace }}/website && /srv/github-action-scripts/build-astro-site.sh | ||
|
||
- name: Check links | ||
run: /srv/github-action-scripts/check-links.sh ${{ github.workspace }}/website/dist | ||
|
||
- name: Make staging directory | ||
run: mkdir -p /srv/s3-staging/${{ env.SITE_URL }} | ||
|
||
- name: Sync build to staging directory | ||
run: rsync -crui ${{ github.workspace }}/website/dist/ /srv/s3-staging/${{ env.SITE_URL }} --delete | ||
|
||
- name: Upload to S3 | ||
run: /srv/github-action-scripts/upload-to-s3-root.sh | ||
|
||
- name: Set up security headers | ||
run: cd /srv/github-action-scripts && pipenv run python lambda-security-headers.py | ||
|
||
- name: Invalidate CloudFront cache | ||
run: /srv/github-action-scripts/invalidate-cloudfront.sh |