Skip to content

Commit 9ad41e0

Browse files
committed
Merge branch 'master' of file:///home/seanho/Documents/sermons/reveal-skel
2 parents 6b040d2 + 9af6bc6 commit 9ad41e0

4 files changed

Lines changed: 3842 additions & 5219 deletions

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,51 @@
1-
name: Build static site
1+
name: Build and deploy static site
22
on:
33
push:
44
branches:
55
- master
66
- $default-branch
77
workflow_dispatch:
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
813
jobs:
914
build:
1015
runs-on: ubuntu-latest
1116
steps:
1217
- name: Checkout repo from Github
13-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1419
- name: Update package list
1520
run: sudo apt update
1621
- name: Install gs
1722
run: sudo apt install ghostscript
1823
- name: Configure node.js
19-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2025
with:
21-
node-version: '20'
26+
node-version: '22'
2227
cache: 'npm'
2328
- name: Clean install node package
2429
run: npm ci
2530
- name: Build node package
2631
run: npm run build --if-present
2732
- name: Run node package tests
2833
run: npm test
29-
- name: Deploy to gh-pages
30-
uses: JamesIves/github-pages-deploy-action@v4.2.5
34+
- name: Upload artifact
35+
id: upload-artifact
36+
uses: actions/upload-pages-artifact@v3
3137
with:
32-
branch: gh-pages
33-
folder: dist
38+
name: 'site'
39+
path: 'dist'
40+
41+
deploy:
42+
needs: build
43+
runs-on: ubuntu-latest
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
steps:
48+
- name: Deploy to Github Pages
49+
uses: actions/deploy-pages@v4
50+
with:
51+
artifact_name: 'site'

INSTALL.md

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
## Intro
44
Reveal-skel is a forkable template for a presentation based on the [Reveal.js](http://lab.hakim.se/reveal-js/) HTML framework.
55

6-
[Travis-CI config](.travis.yml)
6+
The Github Actions workflow in [build.yml](.github/workflows/build.yml)
77
runs a [Node.js project](package.json),
88
calling [Grunt tasks](Gruntfile.coffee) to
99
build [the presentation](template/index.html) as a website and
10-
deploy it on Github Pages via the `gh-pages` branch.
10+
deploy it on Github Pages.
1111

1212
## Usage
1313
* **Fork** the [reveal-skel](https://github.com/sermons/reveal-skel) project
1414
+ Or in your own git repo, run `git remote add upstream https://github.com/sermons/reveal-skel`
15-
* Setup a **Github token** for Travis [(see below)](#github-token-for-travis)
15+
+ In the Github settings for your forked repository, under 'Pages', set the 'Source' to 'Github Actions'.
16+
+ This allows the [deploy-pages](https://github.com/actions/deploy-pages) action to deploy directly to Github Pages,
17+
without using a `gh-pages` branch.
1618
* **Edit** [package.json](package.json):
1719
+ Package name, git repo, CNAME
1820
+ Change `sample.md` to `slides.md`
@@ -25,38 +27,6 @@ deploy it on Github Pages via the `gh-pages` branch.
2527
* Static **assets** (CSS, JS, images, etc) go in [`static`](static)
2628
+ Grunt will copy this dir as-is to the root of the deployed site
2729

28-
## Github token for Travis
29-
+ **Connect** [Travis](https://travis-ci.com) to your Github account, if you haven't already
30-
+ On Github, create an access token: *Settings* → *Developer Settings* → *Personal access tokens* → **Generate new token**
31-
+ *Token description*: e.g., "Travis push to gh-pages"
32-
+ *Select scopes*: check "**repo**"
33-
+ Press the **Generate token** button at the bottom
34-
+ Copy and **save** the token outside the repo:
35-
+ `echo "github_key=...MY_GITHUB_TOKEN..." > ~/.travis-key.conf`
36-
+ [Install](https://github.com/travis-ci/travis.rb#installation) the Travis **gem**
37-
+ See note in the [travis-key script](travis-key) for details
38-
+ Run `./travis-key` to [securely store the token in Travis](https://docs.travis-ci.com/user/encrypting-files/):
39-
+ Commit, **push**, and check the [build log](https://travis-ci.com/) for errors
40-
41-
## Bot user for Travis deploy
42-
If you don't want Travis to have full write-access
43-
to all your repos, you may want to create a
44-
**special user** just for pushing to the `gh-pages`
45-
branch. This is what I do:
46-
47-
+ Create a new Github **user** (a 'bot')
48-
+ In the bot account, create an **access token** as above
49-
+ **Save** the token out-of-repo in `~/.travis-key.conf`
50-
+ In your main account, add the bot as a **collaborator** on your repo:
51-
+ "*Settings*" → "*Collaborators & teams*" → "*Collaborators*"
52-
+ Give the bot **Write** access so it can push
53-
+ Or: [add the bot to an organization](https://developer.github.com/guides/managing-deploy-keys/#machine-users)
54-
+ **Prevent** the bot from pushing to master:
55-
+ "*Settings*" → "*Branches*" → "*Protected branches*" → "*master*"
56-
+ Check "*Protect this branch*" and "*Restrict who can push to this branch*"
57-
+ Now the bot can **only** push to gh-pages
58-
+ Run the **script** `./travis-key` in each repo
59-
6030
## Multiplex (remote-control)
6131
Don't use the default multiplex socket ID in the template, or your presentation
6232
can be controlled by anyone with the corresponding secret

0 commit comments

Comments
 (0)