image: elixir:1.14.1

pages:
  script:
    - mix local.hex --force
    - mix local.rebar --force
    - mix deps.get
    - mix esbuild.install --if-missing
    - mix tailwind.install --if-missing
    - mix tree_sitter.install --if-missing
    - (cd tree-sitter/_parsers/;git clone https://github.com/elixir-lang/tree-sitter-elixir; git clone https://github.com/camdencheek/tree-sitter-dockerfile)
    - mix assets.build
    - mix pre_dot_hn.build
    - cp -r priv/static/ public
  artifacts:
    paths:
      - public

# This sequences waits 10 seconds after deploy (for GitLab pages to do its thing, then pings search engines)
# I wish we could just depend on the pages:deploy job that GitLab inserts, but apparently we can't reference it.
wait:
  needs:
  - "pages"
  script:
  - sleep 10
ping:
  needs:
  - "wait"
  script:
  - mix pre_dot_hn.ping