diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..64c43d5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,59 @@ +--- +name: Docs + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: "3.11" + - uses: pre-commit/action@v3.0.1 + + build: + runs-on: ubuntu-latest + defaults: + # This is necessary due to the use of the setup-miniconda action below. See their documentation + # at https://github.com/conda-incubator/setup-miniconda#usage-examples + run: + shell: bash -el {0} + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + - uses: conda-incubator/setup-miniconda@v4 + with: + environment-file: environment.yml + - run: sphinx-build -M html src build + - uses: actions/upload-pages-artifact@v5 + with: + path: build/html + + deploy: + needs: build + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 696e79c..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -default: - tags: - - docker - -include: - - project: "ics-infrastructure/gitlab-ci-yml" - file: "PreCommit.gitlab-ci.yml" - -stages: [check, build, deploy] - -build: - stage: build - image: registry.esss.lu.se/ics-docker/sphinx - script: - - sphinx-build -M html src build -W --keep-going - artifacts: - paths: - - build - -pages: - stage: deploy - script: - - mv build/html public - artifacts: - paths: - - public - rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' diff --git a/README.md b/README.md index 126475f..e8689e7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # e3 documentation -Source for e3 documentation hosted on GitLab pages: https://e3.pages.ess.eu - -The URL relies on this project's path, see https://docs.gitlab.com/user/project/pages/getting_started_part_one/#gitlab-pages-default-domain-names. +Source for e3 documentation hosted on GitHub pages: https://epics-e3.github.io The documentation is built using [Sphinx](http://www.sphinx-doc.org/en/master/index.html) and diff --git a/src/conf.py b/src/conf.py index b615d8c..d6c0cbc 100644 --- a/src/conf.py +++ b/src/conf.py @@ -14,9 +14,11 @@ # The full version, including alpha/beta/rc tags try: - # CI_COMMIT_REF_NAME is defined by GitLab Runner - # The branch or tag name for which project is built - release = os.environ["CI_COMMIT_REF_NAME"] + # GITHUB_REF_NAME is defined by a github runner, and is + # the branch or tag name for which project is built + # + # See https://docs.github.com/en/actions/reference/workflows-and-actions/variables + release = os.environ["GITHUB_REF_NAME"] except KeyError: # Fallback in dev mode release = os.popen("git describe").read().strip() @@ -56,16 +58,14 @@ html_theme_options = { "navigation_with_keys": True, "top_of_page_button": "edit", - "source_repository": "https://gitlab.esss.lu.se/e3/e3.pages.ess.eu", + "source_repository": "https://github.com/epics-e3/epics-e3.github.io", "source_branch": "main", "source_directory": "src/", - "source_edit_link": "https://gitlab.esss.lu.se/e3/e3.pages.ess.eu/-/edit/main/src/{filename}", - "source_view_link": "https://gitlab.esss.lu.se/e3/e3.pages.ess.eu/-/blob/main/src/{filename}", "sidebar_hide_name": False, "footer_icons": [ { - "name": "GitLab", - "url": "https://gitlab.esss.lu.se/e3/e3.pages.ess.eu", + "name": "GitHub", + "url": "https://github.com/epics-e3/epics-e3.github.io", "html": "", "class": "", }, @@ -101,7 +101,7 @@ intersphinx_mapping = { "python": ("https://docs.python.org/3/", None), - "e3": ("https://e3.pages.ess.eu/", None), + "e3": ("https://epics-e3.github.io/", None), "epics": ("https://docs.epics-controls.org/en/latest/", None), }