-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (35 loc) · 1.22 KB
/
build.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
name: Build
on: push
jobs:
build:
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# deep clone on the `main` branch, so we can properly generated Last Modified metadata for posts based on
# git commit history (via `jekyll-last-modified-at` gem)
fetch-depth: ${{ github.ref == 'refs/heads/main' && '0' || '1' }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Build site
run: JEKYLL_ENV=production bundle exec jekyll build
- name: Configure AWS Credentials
if: ${{ github.ref == 'refs/heads/main' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::107111673154:role/benlimmer.com-deploy
aws-region: us-east-1
- name: Deploy site
if: ${{ github.ref == 'refs/heads/main' }}
run: |
export GOPATH=~/go
go install github.com/bep/s3deploy/[email protected]
./deploy.sh