-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (40 loc) · 1.43 KB
/
publish-site.yaml
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
name: Publish Site
on:
push:
branches:
- main
permissions:
contents: read
jobs:
publish-docs:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
# Ensures only one job per workflow and branch runs at a time
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Ruby
uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
with:
ruby-version: "3.3"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build YARD docs and Jekyll site
run: bundle exec rake site:build
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
# The GitHub Actions runner automatically creates this `GITHUB_TOKEN` secret
github_token: ${{ secrets.GITHUB_TOKEN }}
# The output directory for Jekyll
publish_dir: config/site/_site
# The branch to push to for GitHub Pages
publish_branch: gh-pages
enable_jekyll: true