Skip to content

Commit 769e182

Browse files
committed
🚀 CI: Add GitHub Actions CI/CD with Fedora containers
Replace the defunct Travis CI pipeline with GitHub Actions running in Fedora minimal containers. - CI runs lint (`ruff`) and tests (`pytest`) on every push and PR using `fedora-minimal:43` with the default Python 3.14 runtime - Preview builds freeze the site into static HTML and upload it as a downloadable artifact for non-`main` branches (retained 7 days) - Deploy workflow generates the static site via Frozen-Flask and publishes to GitHub Pages on push to `main` - Add `freeze.py` to enumerate all freezable routes while excluding dynamic endpoints like `/blog/<username>` that parse live RSS feeds - Use `actions/checkout@v6`, `ruff --fix` for environment-portable import sorting - Add modern `README.md` with Fedora Linux 43 setup instructions, replacing the outdated `README.rst` (Python 2, `yum`, OpenShift 2 references, etc.) Assisted-by: Claude Opus 4.6 (1M context) Signed-off-by: Justin Wheeler <git@jwheel.org>
1 parent 6367c00 commit 769e182

File tree

11 files changed

+309
-174
lines changed

11 files changed

+309
-174
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
container:
13+
image: registry.fedoraproject.org/fedora-minimal:43
14+
15+
steps:
16+
- name: Install system dependencies
17+
run: microdnf install -y python3 python3-pip git-core
18+
19+
- uses: actions/checkout@v6
20+
21+
- name: Install project dependencies
22+
run: pip install -e ".[test]"
23+
24+
- name: Lint with ruff
25+
run: ruff check --fix . && ruff check .
26+
27+
- name: Run tests
28+
run: pytest --tb=short
29+
30+
preview:
31+
if: github.ref != 'refs/heads/main'
32+
needs: test
33+
runs-on: ubuntu-latest
34+
container:
35+
image: registry.fedoraproject.org/fedora-minimal:43
36+
37+
steps:
38+
- name: Install system dependencies
39+
run: microdnf install -y python3 python3-pip git-core
40+
41+
- uses: actions/checkout@v6
42+
43+
- name: Install project dependencies
44+
run: pip install -e .
45+
46+
- name: Freeze static site
47+
run: python3 freeze.py
48+
49+
- name: Upload preview artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: site-preview
53+
path: build/
54+
retention-days: 7
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
container:
20+
image: registry.fedoraproject.org/fedora-minimal:43
21+
22+
steps:
23+
- name: Install system dependencies
24+
run: microdnf install -y python3 python3-pip git-core
25+
26+
- uses: actions/checkout@v6
27+
28+
- name: Install project dependencies
29+
run: pip install -e .
30+
31+
- name: Freeze static site
32+
run: python3 freeze.py
33+
34+
- name: Upload Pages artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: build/
38+
39+
deploy:
40+
needs: build
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

‎.travis.yml‎

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.

‎README.md‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# HFLOSSK
2+
3+
![GitHub Actions CI status](https://github.com/FOSSRIT/hflossk/actions/workflows/ci.yml/badge.svg)
4+
5+
## What is this?
6+
7+
This repository uses Flask, Mako, and Bootstrap to make a website for the Humanitarian Free/Open Source Software Course at RIT.
8+
The content shown here is a compilation of course materials from several different professors, who ran the course multiple semesters.
9+
Those professors were as follows:
10+
11+
- D. Joe
12+
- Dave Shein
13+
- Justin Sherrill
14+
- Ralph Bean
15+
- Remy DeCausemaker
16+
- Stephen Jacobs
17+
18+
19+
## Setting up your development environment
20+
21+
### Fedora Linux 43
22+
23+
Install Python and create a virtual environment:
24+
25+
```bash
26+
sudo dnf install python3 python3-pip git
27+
```
28+
29+
Clone the repository and set up the project:
30+
31+
```bash
32+
git clone git@github.com:FOSSRIT/hflossk.git
33+
cd hflossk
34+
python3 -m venv venv
35+
source venv/bin/activate
36+
pip install -e .
37+
```
38+
39+
### Running locally
40+
41+
With your virtual environment activated:
42+
43+
```bash
44+
python app.py
45+
```
46+
47+
Open [127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser.
48+
The server runs in debug mode and will reload when you change files.
49+
50+
### Running the tests
51+
52+
Install the test dependencies and run with `pytest`:
53+
54+
```bash
55+
pip install -e ".[test]"
56+
pytest
57+
```
58+
59+
Or use `tox` to run the full test suite and linter:
60+
61+
```bash
62+
pip install tox
63+
tox
64+
```
65+
66+
Tests check validity of all YAML files and validate the keys in student YAML files.
67+
The linter (`ruff`) checks code style.
68+
69+
70+
## Building a static site
71+
72+
The site can be frozen into static HTML using Frozen-Flask:
73+
74+
```bash
75+
python freeze.py
76+
```
77+
78+
This generates the site in the `build/` directory.
79+
This is what gets deployed to GitHub Pages on pushes to `main`.
80+
81+
82+
## Course content
83+
84+
The course materials (syllabus, homework assignments, lecture notes) are kept in this repository.
85+
86+
Files ending with `.mak` are written in the [Mako Templating](https://www.makotemplates.org/) language.
87+
Mako files can contain plain HTML or mix Python with HTML.
88+
89+
You should run the server locally to check that your modifications render the way you want before pushing.
90+
91+
92+
## License
93+
94+
© 2013 Remy DeCausemaker
95+
96+
Licensed under the Apache License, Version 2.0 (the "License").
97+
You may not use this file except in compliance with the License.
98+
You may obtain a copy of the License at
99+
100+
> [www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
101+
>
102+
> Unless required by applicable law or agreed to in writing, software distributed
103+
> under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104+
> CONDITIONS OF ANY KIND, either express or implied. See the License for the
105+
> specific language governing permissions and limitations under the License.

‎README.rst‎

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)