Skip to content

Commit 10babf0

Browse files
authored
Merge pull request #146 from ruby/gh-pages-actions
Use GitHub Pages Actions instead of gh-pages branch deployment.
2 parents b417214 + 99e223a commit 10babf0

4 files changed

Lines changed: 39 additions & 20 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,47 @@
1-
name: Build and Deploy
1+
name: Deploy middleman site to Pages
22

33
on:
44
push:
55
branches:
66
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: true
717

818
jobs:
9-
build-and-deploy:
19+
build:
1020
runs-on: ubuntu-latest
1121
steps:
1222
- name: Checkout
13-
uses: actions/checkout@v2
14-
with:
15-
persist-credentials: false
16-
- uses: ruby/setup-ruby@v1
17-
with:
18-
ruby-version: "3.0"
19-
- name: Install dependencies
20-
run: |
21-
gem install bundler -v 2.1.4
22-
bundle install
23-
- name: Build
24-
run: bin/middleman build
25-
- name: Deploy
26-
uses: peaceiris/actions-gh-pages@v3
23+
uses: actions/checkout@v3
24+
- name: Setup Ruby
25+
uses: ruby/setup-ruby@v1
2726
with:
28-
github_token: ${{ secrets.ACCESS_TOKEN }}
29-
publish_dir: ./build
30-
cname: try.ruby-lang.org
27+
ruby-version: '3.2'
28+
bundler-cache: true
29+
- name: Setup Pages
30+
id: pages
31+
uses: actions/configure-pages@v3
32+
- name: Build with middleman
33+
# Outputs to the './_site' directory by default
34+
run: bundle exec middleman build
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v1
37+
38+
deploy:
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
runs-on: ubuntu-latest
43+
needs: build
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/*
2+
_site/*
23
.bundle
34
.idea
45
.ruby-version

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ GEM
116116
mini_portile2 (2.8.1)
117117
minitest (5.17.0)
118118
nio4r (2.5.8)
119-
nokogiri (1.13.10)
119+
nokogiri (1.14.2)
120120
mini_portile2 (~> 2.8.0)
121121
racc (~> 1.4)
122122
opal (1.7.1)

config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
activate :directory_indexes
3030

31+
set :build_dir, '_site' # for GitHub Pages
3132
set :css_dir, 'stylesheets'
3233
set :js_dir, 'javascripts'
3334

0 commit comments

Comments
 (0)