Skip to content

chore: add mastodon backlink #43

chore: add mastodon backlink

chore: add mastodon backlink #43

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Checkout to the current branch
uses: actions/checkout@v4
- name: Setup OCaml with cache
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.1.1"
dune-cache: true
- name: Install deps
run: opam install . -y --deps-only
- name: Build website
run: opam exec -- dune exec ./bin/maiste.exe
- name: Clean dir
run: |
rm -rf bin contents dune-project LICENSE maiste-web.opam maiste-web.opam.templatepages README.md templates
mv target /tmp
mv _opam /tmp
# "--allow-empty" ensures we have a trace of when the CI is triggered.
- name: Import content and push to GitHub Pages branch
run: |
git config --global user.name 'Archimedes'
git config --global user.email '[email protected]'
git fetch origin gh-pages
git switch gh-pages
rm -rf ./*
mv /tmp/target/* ./
git add -A .
git commit -m "Blog v$(date +'%Y-%m-%d')" --allow-empty
git push origin gh-pages
# We need to move opam dir to make sure it doesn't break the cache.
- name: Restore Opam state
run: mv /tmp/_opam ./