-
Notifications
You must be signed in to change notification settings - Fork 131
37 lines (30 loc) · 1.05 KB
/
main.yml
File metadata and controls
37 lines (30 loc) · 1.05 KB
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 and deploy
on:
push:
branches: [ master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout the latest code'
uses: actions/checkout@v3.3.0
- name: 'Inject slug/short variables'
uses: rlespinasse/github-slug-action@v4.4.0
- name: 'Update site with run number'
run: |
sed -i "s/#BUILD_ID#/${{ env.GITHUB_REF_SLUG_URL }}-${{ github.run_id }}/g" _includes/nav.html
- name: 'Update site with SHA'
run: |
sed -i "s/#COMMIT_ID#/${{ env.GITHUB_SHA_SHORT }}/g" _includes/nav.html
# Use GitHub Actions' cache to shorten build times and decrease load on servers
- name: 'Cache gems'
uses: actions/cache@v3.2.3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- name: 'Build and publish Jekyll to GitHub Pages'
uses: helaili/jekyll-action@v2.4
with:
token: ${{ secrets.GITHUB_TOKEN }}