Skip to content

Commit

Permalink
Auto-deploy/publish to gh-pages w/ GitHub Actions (#466)
Browse files Browse the repository at this point in the history
This is based on the setup Domenic Denicola put together at
https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
  • Loading branch information
sideshowbarker authored Feb 19, 2021
1 parent a036e31 commit be9f7cf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: make ci
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL=/bin/bash

all: index.html ./api/index.html ./cookies/index.html ./pinning/index.html

force:
Expand Down Expand Up @@ -26,3 +28,22 @@ pinning/index.html: pinning/index.src.html

publish:
git push origin master

ci: out/index.html

out/index.html: index.src.html
mkdir -p out
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output $@ \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=nothing \
-F file=@$<) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat $@; echo ""; \
$(RM) -r out; \
exit 22 \
);

clean:
$(RM) -r out

0 comments on commit be9f7cf

Please sign in to comment.