Skip to content

Commit

Permalink
Merge pull request #240 from UCL/saransh/revamp-packaging
Browse files Browse the repository at this point in the history
refactor: update packaging content + better site infra
  • Loading branch information
dpshelio authored Aug 14, 2024
2 parents 6741f65 + ee3c6ff commit 7fc11f8
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 124 deletions.
43 changes: 25 additions & 18 deletions .github/workflows/build_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
Build-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Adds keys to work with other repositories used in this lesson (e.g., UCL/github-example)
- uses: webfactory/ssh-agent@v0.5.4
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/cache@v2 # FIXME: add apt(latex)
- uses: actions/cache@v4 # FIXME: add apt(latex)
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '.github/python/requirements.txt') }}
Expand All @@ -31,23 +31,30 @@ jobs:
uses: DanySK/[email protected]
- id: setup-python
name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: ".github/python/requirements.txt"
run: python -m pip install -r .github/python/requirements.txt
- name: Building notes
run: make ready
- name: Builds website
uses: helaili/jekyll-action@v2
- uses: ruby/setup-ruby@v1
with:
target_branch: 'gh-pages'
build_only: true
- name: Build website and deploy
if: github.ref == 'refs/heads/main'
uses: helaili/jekyll-action@v2
ruby-version: '3.3'
- name: Install bundler and dependencies
run: |
gem install bundler
bundle install
- name: Build website
run: bundle exec jekyll build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
target_branch: 'gh-pages'
token: ${{ secrets.GITHUB_TOKEN }}
path: _site
- name: Deploy to GitHub Pages
if: >
success()
&& github.ref == 'refs/heads/main'
&& github.repository == 'UCL/rsd-engineeringcourse'
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ master.zip
session04/greetings/Greetings.egg-info/
session04/greetings/doc/
session04/greetings/scripts/
Gemfile.lock
.env/

3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'https://rubygems.org'

gem 'jekyll', '~> 4.2.1'
gem "jekyll"
gem 'kramdown', '~> 2.3.1'
gem "jekyll-remote-theme"
gem "jekyll-sass-converter"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ $ docker run --rm --volume="$PWD:/srv/jekyll" --volume="$PWD/vendor/bundle:/usr/
and open http://localhost:4000/rsd-engineeringcourse (or the link provided).
Note that this is mounting the `bundle` directory where `act` will create them.


# Migration from jupyter notebooks to py:percent

Using `jupytext` we've converted all the jupyter notebooks into plain text python files (py:percent) with:
Expand Down
Loading

0 comments on commit 7fc11f8

Please sign in to comment.