Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure code #1

Merged
merged 2 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 43 additions & 16 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,29 @@ name: Github Pages
on:
push:
branches:
- main
- "**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true


jobs:
deploy:
build:
runs-on: ubuntu-22.04
env:
# Directory that will be published on github pages
PUBLISH_DIR: ./docs/_build/html
PUBLISH_DIR: ./_build/html

steps:
- uses: actions/checkout@v3
Expand All @@ -23,19 +39,30 @@ jobs:
run: python3 -m pip install -r requirements-docs.txt

- name: Build docs
run: jupyter book build docs
run: jupyter book build .

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{ env.PUBLISH_DIR }}

- name: Copy requirements.txt into gh-pages
run: cp requirements.txt ${PUBLISH_DIR}/

- name: Copy code and data into gh-pages
run: |
cp -r code ${PUBLISH_DIR}/
cp -r data ${PUBLISH_DIR}/
cp runtime.txt ${PUBLISH_DIR}/
# Single deploy job since we're just deploying
deploy:
if: github.ref == 'refs/heads/main'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
_build/

# PyBuilder
.pybuilder/
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 Simula Reaseach Laboratory
Copyright 2022 Simula Research Laboratory

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Supplementary code for the paper: Title of paper

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/scientificcomputing/example-paper/HEAD)

This repository contains supplementary code for the paper
> Finsberg, H., Dokken, J. 2022.
Expand Down
7 changes: 3 additions & 4 deletions docs/_config.yml → _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

title: Example paper
author: Henrik Finsberg
logo: "logo.png"
logo: "docs/logo.png"
copyright: "2022"

# Force re-execution of notebooks on each build.
Expand All @@ -14,8 +14,7 @@ execute:
# Information about where the book exists on the web
repository:
url: https://github.com/scientificcomputing/example-paper # Online location of your book
path_to_book: _sources # Optional path to your book, relative to the repository root
branch: gh-pages # Which branch of the repository should be used when creating links (optional)
branch: main # Which branch of the repository should be used when creating links (optional)

launch_buttons:
notebook_interface: "jupyterlab" # The interface interactive links will activate ["classic", "jupyterlab"]
Expand All @@ -33,7 +32,7 @@ parse:

sphinx:
config:
bibtex_bibfiles: ["refs.bib"]
bibtex_bibfiles: ["docs/refs.bib"]

extra_extensions:
- 'sphinx.ext.autodoc'
Expand Down
8 changes: 8 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
format: jb-book
root: index

chapters:
- file: docs/abstract
- file: docs/reproducing
- file: code/demo
- file: docs/citation
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ARG REPO_BRANCH="main"

WORKDIR /repo

# Copy pyproject.toml first so that we done need to reinstall in case anoter file
# is changing ater rebuiding docker image
# Copy pyproject.toml first so that we done need to reinstall in case another file
# is changing after rebuiding docker image
RUN git clone --branch ${REPO_BRANCH} --single-branch https://github.com/scientificcomputing/example-paper.git
RUN cd example-paper && python3 -m pip install pip --upgrade && python3 -m pip install --no-cache-dir -r requirements.txt && rm -rf /tmp
RUN cd example-paper && python3 -m pip install --no-cache-dir -r requirements.txt && rm -rf /tmp
8 changes: 0 additions & 8 deletions docs/_toc.yml

This file was deleted.

File renamed without changes.