diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..260df28 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,64 @@ +name: Build and Deploy to GitHub Pages + +on: + push: + branches: [ source ] + pull_request: + branches: [ source ] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.7" + + - name: Install dependencies + run: | + pip install -r requirements.txt + # tidy-html5 needs to be installed separately via system package manager + sudo apt-get update && sudo apt-get install -y tidy + + - name: Patch nbconvert to fix filename conflicts + run: | + # Find nbconvert's extractoutput.py and apply the fix + NBCONVERT_PATH=$(python -c "import nbconvert.preprocessors.extractoutput as e; print(e.__file__)") + sed -i 's/if filename in resources\['\''outputs'\''\]:/if filename in resources['\''outputs'\''] and False:/' "$NBCONVERT_PATH" + echo "Applied nbconvert patch to disable duplicate filename check" + + - name: Build site + run: | + python make.py publish + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./output_branch + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/source' + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitmodules b/.gitmodules index 6dfcf3c..d46862e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,16 +12,16 @@ url = https://gist.github.com/6139282.git [submodule "content/notebooks/xkcd_font_glyph_extract"] path = content/notebooks/xkcd_font_glyph_extract - url = git@gist.github.com:b80e3b3ab9edbda9ac4304f742cf292b.git + url = https://gist.github.com/b80e3b3ab9edbda9ac4304f742cf292b.git [submodule "content/notebooks/xkcd_font_stroke_classification"] path = content/notebooks/xkcd_font_stroke_classification url = https://gist.github.com/pelson/1d6460289f06acabb650797b88c15ae0 [submodule "content/notebooks/xkcd_font_svg_and_creation"] path = content/notebooks/xkcd_font_svg_and_creation - url = git@gist.github.com:18434e3bd37dcde8dd28a5a24def0060.git + url = https://gist.github.com/18434e3bd37dcde8dd28a5a24def0060.git [submodule "content/field_notes/lfric_containment"] path = content/field_notes/lfric_containment - url = git@gist.github.com:26b288663d67f8a418cfd7e023520e3c.git + url = https://gist.github.com/26b288663d67f8a418cfd7e023520e3c.git [submodule "content/field_notes/coast_path_pt1"] path = content/field_notes/coast_path_pt1 - url = git@gist.github.com:21fbdc5a944f478bdd896faa95ab3cc7.git + url = https://gist.github.com/21fbdc5a944f478bdd896faa95ab3cc7.git diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1274cda..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: python - -env: - global: - # travis encrypt GIT_EMAIL= GH_TOKEN= - secure: muOdofd/oT849Qe5iFtEjn11vvOQUvYXCJ9gN+/K0TS9wUX9+QDk3qoTRKoyBKw8EAVfNT6wcfESRoRh8iug1YHUweKPlxUgoqzqTzT3ailxC2qX6n79lqaAyRK+AeclDZGH0ESze8wNZYZzKanicC3X84GVYJpst+DiEDue3MM= - -branches: - only: - - source - -git: - submodules: false - -sudo: false - -install: -- set -e -- openssl aes-256-cbc -K $encrypted_9f32b8d262b8_key -iv $encrypted_9f32b8d262b8_iv -in deploy-key.enc -out deploy-key -d -- chmod 600 deploy-key && eval `ssh-agent -s` && ssh-add deploy-key -- git config --global user.name "Phil Elson" -- git config --global user.email $GIT_EMAIL - -- export CONDA_BASE=http://repo.continuum.io/miniconda/Miniconda3 -- wget ${CONDA_BASE}-latest-Linux-x86_64.sh -O miniconda.sh; -- bash miniconda.sh -b -p $HOME/miniconda -- export PATH="$HOME/miniconda/bin:$PATH:$(pwd)" -- conda config --set show_channel_urls True -- conda install --yes --quiet -c conda-forge conda-execute conda=4.5.3 - -- noleaky git submodule update --quiet --init --recursive -- noleaky git clone --depth=50 --branch=master git@github.com:pelson/pelson.github.io.git output_branch - -- echo "Built from the following commits:" -- git log --oneline -n 1 >> log_message.txt -- LOG_MESSAGE=$(cat log_message.txt) - - -script: - -- conda execute -v make.py publish -- cd output_branch -- git add --all * -- git status -- git commit -am "${LOG_MESSAGE}" -- noleaky git push origin master diff --git a/deploy-key.enc b/deploy-key.enc deleted file mode 100644 index 9114d00..0000000 Binary files a/deploy-key.enc and /dev/null differ diff --git a/extras/pelican-plugins b/extras/pelican-plugins index c0d0756..1958d21 160000 --- a/extras/pelican-plugins +++ b/extras/pelican-plugins @@ -1 +1 @@ -Subproject commit c0d0756776a8ff65069de3601a0a880c7fe74a3f +Subproject commit 1958d21ba0563edb00e7571fc28ecd987047ad76 diff --git a/make.py b/make.py index 412ea33..ddcdda0 100755 --- a/make.py +++ b/make.py @@ -62,7 +62,7 @@ def publish(): new = os.path.join(new_root, fname) if fname.endswith('.html'): print('\nConverting {}:'.format(old)) - cmd = ['tidy5', '-config', 'tidy_config.txt', old] + cmd = ['tidy', '-config', 'tidy_config.txt', old] with open(new, 'w') as fh: try: code = subprocess.check_call(cmd, stdout=fh) @@ -77,7 +77,7 @@ def publish(): if os.path.isdir(fname): shutil.copytree(fname, os.path.join('output_branch', os.path.basename(fname))) elif fname.endswith('.html'): - cmd = ['tidy5', '-config', 'tidy_config.txt', fname] + cmd = ['tidy', '-config', 'tidy_config.txt', fname] with open(os.path.join('output_branch', os.path.basename(fname)), 'w') as fh: subprocess.check_call(cmd, stdout=fh) else: diff --git a/noleaky b/noleaky deleted file mode 100755 index d8d7d25..0000000 --- a/noleaky +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -"$@" 2>&1 | sed -e "s:${GH_TOKEN}::g"; -exit $? diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..e51d57b --- /dev/null +++ b/requirements.in @@ -0,0 +1,8 @@ +pelican==3.7 +markdown<3.0 +ipython==3.* +notebook +nbconvert==5.* +pygments +jinja2<3.0 +markupsafe<2.0 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0cd28aa --- /dev/null +++ b/requirements.txt @@ -0,0 +1,57 @@ +anyio==3.7.1 +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +attrs==24.2.0 +bleach==6.0.0 +blinker==1.6.3 +cffi==1.15.1 +defusedxml==0.7.1 +docutils==0.20.1 +entrypoints==0.4 +exceptiongroup==1.3.0 +fastjsonschema==2.21.1 +feedgenerator==2.1.0 +idna==3.10 +importlib-metadata==6.7.0 +importlib-resources==5.12.0 +ipykernel==4.0.1 +ipython==3.2.3 +ipython-genutils==0.2.0 +Jinja2==2.11.3 +jsonschema==4.17.3 +jupyter-server==1.15.6 +jupyter_client==7.4.9 +jupyter_core==4.12.0 +Markdown==2.6.11 +MarkupSafe==1.1.1 +mistune==0.8.4 +nbclassic==1.2.0 +nbconvert==5.6.1 +nbformat==5.8.0 +nest-asyncio==1.6.0 +notebook==6.5.7 +notebook_shim==0.2.4 +packaging==24.0 +pandocfilters==1.5.1 +pelican==3.7.0 +pkgutil_resolve_name==1.3.10 +prometheus-client==0.17.1 +ptyprocess==0.7.0 +pycparser==2.21 +Pygments==2.17.2 +pyrsistent==0.19.3 +python-dateutil==2.9.0.post0 +pytz==2025.2 +pyzmq==26.2.1 +Send2Trash==1.8.3 +six==1.17.0 +sniffio==1.3.1 +terminado==0.17.1 +testpath==0.6.0 +tornado==6.2 +traitlets==5.9.0 +typing_extensions==4.7.1 +Unidecode==1.4.0 +webencodings==0.5.1 +websocket-client==1.6.1 +zipp==3.15.0