Compare commits
28 Commits
1ae89f63d0
...
2025-2026
Author | SHA1 | Date | |
---|---|---|---|
4e3af32f41 | |||
bcd9480e66 | |||
4c22c889bf | |||
fbd7a0ce54 | |||
5e5a40eebe | |||
5d81ca35c5 | |||
1aede656fa | |||
3c9feb0cf5 | |||
ec8d4d23b7 | |||
7577854064 | |||
9e8d523de1 | |||
03290ee848 | |||
be17a9952c | |||
251d637a7b | |||
711fbb12d5 | |||
cadbaa163e | |||
29a9a51543 | |||
e6642eaeaa | |||
8674186937 | |||
61bf2af24c | |||
ae080680ad | |||
b87388939f | |||
340f10a023 | |||
435c787b2e | |||
cb9820afa5 | |||
5f7dea074e | |||
0194eb763e | |||
0d4e4d74b0 |
30
.drone.yml
30
.drone.yml
@@ -1,30 +0,0 @@
|
||||
kind: pipeline
|
||||
name: Opytex 2021-2022
|
||||
type: docker
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- 2021-2022
|
||||
|
||||
steps:
|
||||
- name: Deploy
|
||||
image: python:3.8-alpine
|
||||
commands:
|
||||
- apk add --no-cache openssh-client ca-certificates bash rsync git imagemagick-dev imagemagick
|
||||
- git submodule init
|
||||
- git submodule update
|
||||
- git clone https://git.opytex.org/lafrite/2021-2022.git content
|
||||
- pip install --no-cache-dir -r requirements.txt
|
||||
- export MAGICK_HOME=/usr
|
||||
- pelican ./content/ -o output -s publishconf.py --relative-urls
|
||||
- eval `ssh-agent -s`
|
||||
- echo "$SSH_KEY" | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
- ssh sshcontent@91.121.90.228 'mkdir -p ~/opytex.org/www/enseignements/2021-2022/'
|
||||
- rsync -rv --delete -e "ssh -p 22" ./output/ sshcontent@91.121.90.228:~/opytex.org/www/enseignements/2021-2022/ --checksum
|
||||
environment:
|
||||
SSH_KEY:
|
||||
from_secret: sshcontent-key
|
||||
|
||||
|
107
.gitea/workflows/deploy.yml
Normal file
107
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,107 @@
|
||||
name: Build and Deploy to MinIO
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
# - master
|
||||
- 2025-2026
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
branch-type: ${{ steps.branch-info.outputs.branch-type }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set branch type
|
||||
id: branch-info
|
||||
run: |
|
||||
if [ "${{ gitea.ref }}" = "refs/heads/master" ]; then
|
||||
echo "branch-type=master" >> $GITEA_OUTPUT
|
||||
else
|
||||
echo "branch-type=year" >> $GITEA_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y imagemagick libmagickwand-dev ghostscript
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
- name: Setup content directory for year branches
|
||||
env:
|
||||
BRANCH_NAME: ${{ gitea.ref_name }}
|
||||
if: gitea.ref != 'refs/heads/master'
|
||||
run: |
|
||||
echo "Branch name: $BRANCH_NAME"
|
||||
echo "Testing URL: https://git.opytex.org/Cours/${BRANCH_NAME}.git"
|
||||
curl -I "https://git.opytex.org/Cours/${BRANCH_NAME}.git" || echo "URL not accessible"
|
||||
rm -rf content
|
||||
git clone https://git.opytex.org/Cours/${BRANCH_NAME}.git content
|
||||
|
||||
- name: Build site
|
||||
run: |
|
||||
export MAGICK_HOME=/usr
|
||||
pelican ./content/ -o ./output -s publishconf.py --relative-urls
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: site-build
|
||||
path: output/
|
||||
retention-days: 1
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: site-build
|
||||
path: output/
|
||||
|
||||
- name: Install MinIO client
|
||||
run: |
|
||||
wget https://dl.min.io/client/mc/release/linux-amd64/mc
|
||||
chmod +x mc
|
||||
sudo mv mc /usr/local/bin/
|
||||
|
||||
- name: Configure MinIO client
|
||||
env:
|
||||
MINIO_REPOSITORY: ${{ secrets.MINIO_REPOSITORY }}
|
||||
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
||||
run: |
|
||||
mc alias set storage $MINIO_REPOSITORY $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
|
||||
|
||||
- name: Deploy to MinIO - Master branch
|
||||
env:
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
if: needs.build.outputs.branch-type == 'master'
|
||||
run: |
|
||||
mc mirror --overwrite --exclude "enseignements/*" ./output/ storage/$MINIO_BUCKET
|
||||
|
||||
- name: Deploy to MinIO - Year branches
|
||||
env:
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
BRANCH_NAME: ${{ gitea.ref_name }}
|
||||
if: needs.build.outputs.branch-type == 'year'
|
||||
run: |
|
||||
mc mirror --overwrite --remove ./output/ storage/$MINIO_BUCKET/enseignements/${BRANCH_NAME}/
|
0
__init__.py
Normal file
0
__init__.py
Normal file
@@ -7,10 +7,11 @@ import sys
|
||||
sys.path.append(os.curdir)
|
||||
from globalconf import *
|
||||
|
||||
YEAR = "2025-2026"
|
||||
AUTHOR = "Benjamin Bertrand"
|
||||
SITENAME = "OpyTex"
|
||||
SITETITLE = "OpyTex"
|
||||
SITESUBTITLE = "2022-2023"
|
||||
SITESUBTITLE = YEAR
|
||||
SITEURL = ""
|
||||
|
||||
CC_LICENSE_COMMERCIAL = True
|
||||
@@ -50,7 +51,7 @@ PLUGINS = [
|
||||
ALWAYS_MODIFIED = True
|
||||
|
||||
# Mirror source structure
|
||||
PATH_METADATA = "(?P<path_no_ext>.*)\..*"
|
||||
PATH_METADATA = r"(?P<path_no_ext>.*)\..*"
|
||||
ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html"
|
||||
|
||||
# USE_FOLDER_AS_CATEGORY = True
|
||||
@@ -93,5 +94,5 @@ AUTHOR_FEED_ATOM = None
|
||||
AUTHOR_FEED_RSS = None
|
||||
|
||||
# SOURCE LINK
|
||||
GIT_SOURCE_BASE_URL = "https://git.opytex.org/lafrite/2022-2023/src/branch/main"
|
||||
GIT_SOURCE_BASE_URL = f"https://git.opytex.org/Cours/{YEAR}/src/branch/main"
|
||||
SOURCE_ICON_URL = "https://git.opytex.org/assets/img/logo.svg"
|
||||
|
@@ -7,19 +7,21 @@ from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(os.curdir)
|
||||
from pelicanconf import *
|
||||
|
||||
|
||||
# If your site is available via HTTPS, make sure SITEURL begins with https://
|
||||
SITEURL = 'https://opytex.org/enseignements/2022-2023/'
|
||||
SITEURL = "https://opytex.org/enseignements/2025-2026/"
|
||||
RELATIVE_URLS = False
|
||||
|
||||
FEED_ALL_ATOM = 'feeds/all.atom.xml'
|
||||
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
|
||||
FEED_ALL_ATOM = "feeds/all.atom.xml"
|
||||
CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml"
|
||||
|
||||
DELETE_OUTPUT_DIRECTORY = True
|
||||
|
||||
# Following items are often useful when publishing
|
||||
|
||||
#DISQUS_SITENAME = ""
|
||||
#GOOGLE_ANALYTICS = ""
|
||||
# DISQUS_SITENAME = ""
|
||||
# GOOGLE_ANALYTICS = ""
|
||||
|
@@ -1,15 +1,23 @@
|
||||
anyio==4.10.0
|
||||
beautifulsoup4==4.9.1
|
||||
blinker==1.4
|
||||
blinker==1.9.0
|
||||
bs4==0.0.1
|
||||
docutils==0.16
|
||||
feedgenerator==1.9.1
|
||||
Jinja2==2.11.2
|
||||
MarkupSafe==1.1.1
|
||||
pelican==4.2.0
|
||||
Pygments==2.6.1
|
||||
python-dateutil==2.8.1
|
||||
docutils==0.22
|
||||
feedgenerator==2.2.1
|
||||
idna==3.10
|
||||
Jinja2==3.1.6
|
||||
markdown-it-py==4.0.0
|
||||
MarkupSafe==3.0.2
|
||||
mdurl==0.1.2
|
||||
ordered-set==4.1.0
|
||||
pelican==4.11.0
|
||||
Pygments==2.18.0
|
||||
python-dateutil==2.9.0.post0
|
||||
pytz==2020.1
|
||||
six==1.15.0
|
||||
rich==14.1.0
|
||||
six==1.17.0
|
||||
sniffio==1.3.1
|
||||
soupsieve==2.0.1
|
||||
Unidecode==1.1.1
|
||||
Unidecode==1.4.0
|
||||
Wand==0.6.2
|
||||
watchfiles==1.1.0
|
||||
|
Reference in New Issue
Block a user