-
Notifications
You must be signed in to change notification settings - Fork 437
69 lines (59 loc) · 1.87 KB
/
publish-landing-page.yaml
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
63
64
65
66
67
68
69
name: Publish landing page
on:
push:
branches:
- main
paths:
- 'arrow-site/**'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_CLOUDFRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }}
AWS_DEFAULT_REGION: eu-west-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
JEKYLL_ENV: production
S3_BUCKET: ${{ secrets.S3_BUCKET }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
- name: Prepare documentation environment
working-directory: arrow-site
run: |
mkdir logs
brew install tree
gem install bundler
bundle config set --local path 'vendor/bundle'
bundle install --gemfile Gemfile
- name: Build landing page
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs -s docs --config docs/_config_for_landing_page.yml
tree _site > logs/content.log
- name: Publish landing page
working-directory: arrow-site
run: |
echo ">>> Landing page" >> logs/aws_sync.log
set -e
cd _site/
for file in *; do
if [ -f "$file" ]; then
echo "Copying $file ..."
aws s3 cp $file s3://$S3_BUCKET/$file >> logs/aws_sync.log
continue
fi
echo "Sync $file ..."
aws s3 sync $file s3://$S3_BUCKET/$file --delete >> logs/aws_sync.log
done
- name: Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_ID --paths "/*" >> logs/aws_cloudfront.log
- uses: actions/upload-artifact@v3
with:
name: landing-page-logs
path: logs/