-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (71 loc) · 2.41 KB
/
ci.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Build with Jekyll
run: bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: Archive Jekyll build
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v3
with:
name: site
path: ./_site
retention-days: 3
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
concurrency: deploy_to_s3
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Jekyll build
uses: actions/download-artifact@v3
with:
name: site
path: ./_site
- name: Setup Ruby
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Install s3_website
run: bundle exec s3_website install
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ vars.AWS_DEPLOY_ROLE_ARN }}
aws-region: us-east-1
- name: Run s3_website
run: java -cp $(bundle show s3_website)/*.jar s3.website.Push
env:
S3_BUCKET: ${{ vars.S3_BUCKET }}
- name: Purge Cloudflare cache
run: |
curl \
-X POST "https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/purge_cache" \
-H "Authorization: Bearer ${CF_API_TOKEN}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
env:
CF_ZONE_ID: ${{ vars.CF_ZONE_ID }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}