|
2 | 2 | # They are provided by a third-party and are governed by
|
3 | 3 | # separate terms of service, privacy policy, and support
|
4 | 4 | # documentation.
|
5 |
| - |
6 |
| -# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
7 | 5 | name: Deploy Jekyll site to Pages
|
8 | 6 |
|
9 | 7 | on:
|
10 |
| - # Runs on pushes targeting the default branch |
11 | 8 | push:
|
12 | 9 | branches: ["master"]
|
13 |
| - |
14 |
| - # Allows you to run this workflow manually from the Actions tab |
15 | 10 | workflow_dispatch:
|
16 | 11 |
|
17 |
| -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
18 | 12 | permissions:
|
19 | 13 | contents: read
|
20 | 14 | pages: write
|
21 | 15 | id-token: write
|
22 | 16 |
|
23 |
| -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
24 |
| -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
25 | 17 | concurrency:
|
26 | 18 | group: "pages"
|
27 | 19 | cancel-in-progress: false
|
28 | 20 |
|
29 | 21 | jobs:
|
30 |
| - # Build job |
31 | 22 | build:
|
32 | 23 | runs-on: ubuntu-latest
|
33 | 24 | steps:
|
34 | 25 | - name: Checkout
|
35 | 26 | uses: actions/checkout@v4
|
| 27 | + |
| 28 | + - name: Install Ruby |
| 29 | + run: | |
| 30 | + sudo apt-get update |
| 31 | + sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev |
| 32 | + curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-installer | bash |
| 33 | + export PATH="$HOME/.rbenv/bin:$PATH" |
| 34 | + eval "$(rbenv init -)" |
| 35 | + rbenv install 3.1.4 |
| 36 | + rbenv global 3.1.4 |
| 37 | + touch /opt/hostedtoolcache/Ruby/3.1.4/x64.complete |
| 38 | +
|
36 | 39 | - name: Setup Ruby
|
37 |
| - uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 |
| 40 | + uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 |
38 | 41 | with:
|
39 | 42 | ruby-version: '3.1' # Not needed with a .ruby-version file
|
40 | 43 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
41 | 44 | cache-version: 0 # Increment this number if you need to re-download cached gems
|
| 45 | + |
42 | 46 | - name: Setup Pages
|
43 | 47 | id: pages
|
44 | 48 | uses: actions/configure-pages@v5
|
| 49 | + |
45 | 50 | - name: Build with Jekyll
|
46 |
| - # Outputs to the './_site' directory by default |
47 | 51 | run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
|
48 | 52 | env:
|
49 | 53 | JEKYLL_ENV: production
|
| 54 | + |
50 | 55 | - name: Upload artifact
|
51 |
| - # Automatically uploads an artifact from the './_site' directory by default |
52 | 56 | uses: actions/upload-pages-artifact@v3
|
53 | 57 |
|
54 |
| - # Deployment job |
55 | 58 | deploy:
|
56 | 59 | environment:
|
57 | 60 | name: github-pages
|
|
0 commit comments