Add workflows to build and deploy.

This commit adds two GitHub workflows that build and deploy CensorBib.

The "build" workflow is run on every push and verifies the validity of
the .bib file -- as seen by our build tool and *not* by LaTeX!

The "deploy" workflow is run whenenver a branch is merged into master,
at which point CensorBib is automatically built and deployed via GitHub
pages.  This means has two advantages:

* First, I no longer need to manually build and deploy CensorBib, and
  can point the domain censorbib.nymity.ch to GitHub pages.

* Second, CensorBib will also be available under
  https://nullhypothesis.github.io/censorbib/
  which may be helpful to users for who my domain is blocked.
This commit is contained in:
Philipp Winter 2024-03-09 15:54:30 -06:00
parent 4be5f7bfb2
commit 1eeb1267b3
17 changed files with 43 additions and 0 deletions

14
.github/workflows/build.yaml vendored Normal file
View file

@ -0,0 +1,14 @@
name: Build
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
go build -C src -o ../compiler
./compiler -path references.bib > /dev/null

28
.github/workflows/deploy-website.yaml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Deploy website
on:
push:
branches:
main
permissions:
contents: write
jobs:
deploy-website:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and Build
run: |
go build -C src -o ../compiler
mkdir build
mv assets build
./compiler -path references.bib > build/index.html
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
# Must be identical to where we wrote the HTML to.
folder: build

View file

Before

Width:  |  Height:  |  Size: 869 B

After

Width:  |  Height:  |  Size: 869 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 880 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 611 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 671 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 917 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 713 B

After

Width:  |  Height:  |  Size: 713 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 440 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 940 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 880 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 891 B

Before After
Before After

1
docs/index.html Normal file
View file

@ -0,0 +1 @@
hello world