This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
62 lines (47 loc) · 1.97 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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:
ssh-key: ${{ secrets.LINARO_BUILD_KEY }}
path: website
- name: Initialise environment
run: cat "$GITHUB_WORKSPACE/website/.github-env-${GITHUB_REF##*/}" >> $GITHUB_ENV
- run: env
- name: Directory push/pop
uses: linaro-its/directory-push-and-pop@v3.0
with:
cacheDirectory: /srv/site-builds
namedDirectory: ${{ env.SITE_URL }}
destinationDirectory: ${{ github.workspace }}/website
- name: Build site
run: /srv/github-action-scripts/build-jekyll-site.sh
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check links
run: /srv/github-action-scripts/check-links.sh ${{ github.workspace }}/website/${{ env.SITE_URL }} --skip-dns-check ${{ github.workspace }}/website/_data/fqdn_exceptions.txt
- name: Check routing rules
run: /srv/github-action-scripts/test-routing-rules.sh
- 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/${{ env.SITE_URL }}/ /srv/s3-staging/${{ env.SITE_URL }} --delete
- name: Upload to S3
run: /srv/github-action-scripts/upload-to-s3-root.sh
- name: Set up Lambda redirect
run: /srv/github-action-scripts/set-up-lambda-redirect.sh ${{ github.workspace }}/website/
- 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