fix: update README.md #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 _build/public /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/public/* ./ | |
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 ./ |