ford icon indicating copy to clipboard operation
ford copied to clipboard

actions: Build Docker container containing FORD

Open kc9jud opened this issue 9 months ago • 2 comments

This constructs an Alpine-based Docker image with FORD installed. This can then be used for CI/CD builds of documentation for projects. For instance, one could then use this for GitLab pages:

.gitlab-ci:

# The Docker image that will be used to build your app
image: ghcr.io/Fortran-FOSS-Programmers/ford:latest
pages:
  script:
    - mkdir -p public
    - ford -o public README.md
  artifacts:
    paths:
      # The folder that contains the files to be exposed at the Page URL
      - public
  rules:
    # This ensures that only pushes to the default branch will trigger
    # a pages deploy
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

kc9jud avatar Apr 28 '24 01:04 kc9jud

Thanks @kc9jud! Is this just to get graphviz installed? It's not immediately obvious to me why this basically couldn't just be pip install ford, rather than building from source directly?

ZedThree avatar Apr 29 '24 14:04 ZedThree

@ZedThree To get GraphViz to work I just had to switch back to python:3-slim rather than python:3-alpine...

No, you're right that it could just be pip install ford if it were part of the PyPI pipeline -- building from source was a way of solving the race condition of publishing to PyPI vs downloading/installing from PyPI. You don't want the image for v7.0.6 having v7.0.5 inside because it pulled from PyPI before the publish job finished.

It also means that, for example, ghcr.io/kc9jud/ford:master is an image which always has the latest commit to master, in addition to ghcr.io/kc9jud/ford:latest which has the most recent release.

kc9jud avatar Apr 29 '24 15:04 kc9jud