From 1eeb1267b3e8e4b055a314d3990c8ef354e45815 Mon Sep 17 00:00:00 2001 From: Philipp Winter Date: Sat, 9 Mar 2024 15:54:30 -0600 Subject: [PATCH] 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. --- .github/workflows/build.yaml | 14 +++++++++ .github/workflows/deploy-website.yaml | 28 ++++++++++++++++++ {img => assets}/author-icon.svg | 0 {img => assets}/author-reverse-icon.svg | 0 {img => assets}/bibtex-icon.svg | 0 {img => assets}/cache-icon.svg | 0 {img => assets}/code-icon.svg | 0 {img => assets}/donate-icon.svg | 0 {img => assets}/file-icon.svg | 0 {img => assets}/link-icon.svg | 0 {img => assets}/lock-icon.svg | 0 {img => assets}/pdf-icon.svg | 0 .../research-power-tools-cover.jpg | Bin {img => assets}/update-icon.svg | 0 {img => assets}/year-icon.svg | 0 {img => assets}/year-reverse-icon.svg | 0 docs/index.html | 1 + 17 files changed, 43 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/deploy-website.yaml rename {img => assets}/author-icon.svg (100%) rename {img => assets}/author-reverse-icon.svg (100%) rename {img => assets}/bibtex-icon.svg (100%) rename {img => assets}/cache-icon.svg (100%) rename {img => assets}/code-icon.svg (100%) rename {img => assets}/donate-icon.svg (100%) rename {img => assets}/file-icon.svg (100%) rename {img => assets}/link-icon.svg (100%) rename {img => assets}/lock-icon.svg (100%) rename {img => assets}/pdf-icon.svg (100%) rename {img => assets}/research-power-tools-cover.jpg (100%) rename {img => assets}/update-icon.svg (100%) rename {img => assets}/year-icon.svg (100%) rename {img => assets}/year-reverse-icon.svg (100%) create mode 100644 docs/index.html diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..3682ba5 --- /dev/null +++ b/.github/workflows/build.yaml @@ -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 diff --git a/.github/workflows/deploy-website.yaml b/.github/workflows/deploy-website.yaml new file mode 100644 index 0000000..919411a --- /dev/null +++ b/.github/workflows/deploy-website.yaml @@ -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 diff --git a/img/author-icon.svg b/assets/author-icon.svg similarity index 100% rename from img/author-icon.svg rename to assets/author-icon.svg diff --git a/img/author-reverse-icon.svg b/assets/author-reverse-icon.svg similarity index 100% rename from img/author-reverse-icon.svg rename to assets/author-reverse-icon.svg diff --git a/img/bibtex-icon.svg b/assets/bibtex-icon.svg similarity index 100% rename from img/bibtex-icon.svg rename to assets/bibtex-icon.svg diff --git a/img/cache-icon.svg b/assets/cache-icon.svg similarity index 100% rename from img/cache-icon.svg rename to assets/cache-icon.svg diff --git a/img/code-icon.svg b/assets/code-icon.svg similarity index 100% rename from img/code-icon.svg rename to assets/code-icon.svg diff --git a/img/donate-icon.svg b/assets/donate-icon.svg similarity index 100% rename from img/donate-icon.svg rename to assets/donate-icon.svg diff --git a/img/file-icon.svg b/assets/file-icon.svg similarity index 100% rename from img/file-icon.svg rename to assets/file-icon.svg diff --git a/img/link-icon.svg b/assets/link-icon.svg similarity index 100% rename from img/link-icon.svg rename to assets/link-icon.svg diff --git a/img/lock-icon.svg b/assets/lock-icon.svg similarity index 100% rename from img/lock-icon.svg rename to assets/lock-icon.svg diff --git a/img/pdf-icon.svg b/assets/pdf-icon.svg similarity index 100% rename from img/pdf-icon.svg rename to assets/pdf-icon.svg diff --git a/img/research-power-tools-cover.jpg b/assets/research-power-tools-cover.jpg similarity index 100% rename from img/research-power-tools-cover.jpg rename to assets/research-power-tools-cover.jpg diff --git a/img/update-icon.svg b/assets/update-icon.svg similarity index 100% rename from img/update-icon.svg rename to assets/update-icon.svg diff --git a/img/year-icon.svg b/assets/year-icon.svg similarity index 100% rename from img/year-icon.svg rename to assets/year-icon.svg diff --git a/img/year-reverse-icon.svg b/assets/year-reverse-icon.svg similarity index 100% rename from img/year-reverse-icon.svg rename to assets/year-reverse-icon.svg diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..3b18e51 --- /dev/null +++ b/docs/index.html @@ -0,0 +1 @@ +hello world