Skip to content

Commit a47fcdb

Browse files
authored
Merge pull request #588 from srobo/github-actions-publish
Switch to deploying via GitHub Actions
2 parents 66a4a77 + e516c63 commit a47fcdb

File tree

3 files changed

+71
-40
lines changed

3 files changed

+71
-40
lines changed

.github/workflows/publish.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build & Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
build-validate:
11+
env:
12+
# ruby/setup-ruby@v1 does not offer a way to change the cached gems path.
13+
# See https://github.com/ruby/setup-ruby/issues/291
14+
GLOBAL_GEMS: 1
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Set up Ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
bundler-cache: true
25+
cache-version: 2
26+
27+
- name: Build & Validate
28+
run: rake validate
29+
30+
- name: Upload Pages artifact
31+
uses: actions/upload-pages-artifact@v3
32+
33+
docker:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Build container
39+
run: docker-compose build
40+
41+
- name: Build site in container
42+
run: docker-compose run docs rake build
43+
44+
deploy:
45+
name: Deploy to GitHub Pages
46+
runs-on: ubuntu-latest
47+
needs: build-validate
48+
if: ${{ github.ref == 'refs/heads/main' }}
49+
50+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
51+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
52+
concurrency:
53+
group: "pages"
54+
cancel-in-progress: false
55+
56+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
57+
permissions:
58+
contents: read
59+
pages: write
60+
id-token: write
61+
62+
environment:
63+
name: github-pages
64+
# Tell GitHub where we deployed to
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4

.github/workflows/validate.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.3

0 commit comments

Comments
 (0)