Skip to content

Commit 7fc11f8

Browse files
authored
Merge pull request #240 from UCL/saransh/revamp-packaging
refactor: update packaging content + better site infra
2 parents 6741f65 + ee3c6ff commit 7fc11f8

File tree

5 files changed

+192
-124
lines changed

5 files changed

+192
-124
lines changed

.github/workflows/build_site.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ jobs:
1010
Build-website:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
# Adds keys to work with other repositories used in this lesson (e.g., UCL/github-example)
15-
- uses: webfactory/ssh-agent@v0.5.4
15+
- uses: webfactory/ssh-agent@v0.9.0
1616
with:
1717
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
18-
- uses: actions/cache@v2 # FIXME: add apt(latex)
18+
- uses: actions/cache@v4 # FIXME: add apt(latex)
1919
with:
2020
path: vendor/bundle
2121
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
2222
restore-keys: |
2323
${{ runner.os }}-gems-
24-
- uses: actions/cache@v2
24+
- uses: actions/cache@v4
2525
with:
2626
path: ~/.cache/pip
2727
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '.github/python/requirements.txt') }}
@@ -31,23 +31,30 @@ jobs:
3131
uses: DanySK/[email protected]
3232
- id: setup-python
3333
name: Setup Python
34-
uses: actions/setup-python@v2
34+
uses: actions/setup-python@v5
3535
with:
36-
python-version: 3.8
36+
python-version: 3.12
3737
- name: Install dependencies
38-
uses: py-actions/py-dependency-install@v2
39-
with:
40-
path: ".github/python/requirements.txt"
38+
run: python -m pip install -r .github/python/requirements.txt
4139
- name: Building notes
4240
run: make ready
43-
- name: Builds website
44-
uses: helaili/jekyll-action@v2
41+
- uses: ruby/setup-ruby@v1
4542
with:
46-
target_branch: 'gh-pages'
47-
build_only: true
48-
- name: Build website and deploy
49-
if: github.ref == 'refs/heads/main'
50-
uses: helaili/jekyll-action@v2
43+
ruby-version: '3.3'
44+
- name: Install bundler and dependencies
45+
run: |
46+
gem install bundler
47+
bundle install
48+
- name: Build website
49+
run: bundle exec jekyll build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
5152
with:
52-
target_branch: 'gh-pages'
53-
token: ${{ secrets.GITHUB_TOKEN }}
53+
path: _site
54+
- name: Deploy to GitHub Pages
55+
if: >
56+
success()
57+
&& github.ref == 'refs/heads/main'
58+
&& github.repository == 'UCL/rsd-engineeringcourse'
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ master.zip
8484
session04/greetings/Greetings.egg-info/
8585
session04/greetings/doc/
8686
session04/greetings/scripts/
87+
Gemfile.lock
88+
.env/
89+

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'jekyll', '~> 4.2.1'
3+
gem "jekyll"
44
gem 'kramdown', '~> 2.3.1'
55
gem "jekyll-remote-theme"
6+
gem "jekyll-sass-converter"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ $ docker run --rm --volume="$PWD:/srv/jekyll" --volume="$PWD/vendor/bundle:/usr/
7979
and open http://localhost:4000/rsd-engineeringcourse (or the link provided).
8080
Note that this is mounting the `bundle` directory where `act` will create them.
8181

82+
8283
# Migration from jupyter notebooks to py:percent
8384

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

0 commit comments

Comments
 (0)