-
Notifications
You must be signed in to change notification settings - Fork 17
44 lines (42 loc) · 1.28 KB
/
jekyll-build-push-S3.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
name: Build Landing Page with Jekyll then Upload to S3
on:
push:
paths:
- 'landing/**'
workflow_dispatch:
jobs:
jekyll-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create dist directory
run:
mkdir -p ./dist
- name: Jekyll build
id: jekyll-build
uses: helaili/jekyll-action@v2
with:
jekyll_build_options: --destination ../dist
build_only: true
jekyll_src: landing
- name: List generated files
run:
find ./dist
working-directory: .
- name: Copy to S3
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: 'dist'
destination_dir: ''
- name: Invalidate Cloudfront distribution
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION }}
PATHS: '/*'
AWS_REGION: 'eu-west-3'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}