-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (46 loc) · 1.4 KB
/
build-and-deploy.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
name: Build (and optionally Deploy) the Blog Website
on:
push:
branches: main
pull_request:
branches: main
jobs:
# Build the website
build:
runs-on: ubuntu-latest
env:
JEKYLL_ENV: production
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: recursive
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Build Site
run: |
bundle exec jekyll build # defaults output to './_site'
# This will automatically upload an artifact from the './_site' directory
- name: Upload artifact
if: ${{ success() }}
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: https://wermos.github.io/blog/
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4.0.5