14 Commits

Author SHA1 Message Date
251d637a7b build: mc
All checks were successful
Build and Deploy to MinIO / build-and-deploy (push) Successful in 6m20s
2025-09-05 22:25:18 +02:00
711fbb12d5 build: add deployment 2025-09-05 22:09:43 +02:00
cadbaa163e feat: update version and refs 2025-09-05 22:09:32 +02:00
29a9a51543 import .drone.yml from master
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-25 16:51:17 +02:00
e6642eaeaa change source for pelican
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-25 16:27:51 +02:00
8674186937 fix: variable substition
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-25 16:25:59 +02:00
61bf2af24c fix: variable...
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-25 16:25:03 +02:00
ae080680ad Fix: variable syntax
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-25 16:22:14 +02:00
b87388939f feat: drone for 2022-2023 branch
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-25 16:20:06 +02:00
340f10a023 Fix: change source-link base url 2023-04-15 05:57:15 +02:00
435c787b2e Fix: pelicanconf import
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-14 14:44:55 +02:00
cb9820afa5 Fix: add __init__.py
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-14 14:43:10 +02:00
5f7dea074e Fix: formating
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-14 14:41:25 +02:00
0194eb763e Fix: years 2023-04-14 14:40:51 +02:00
6 changed files with 191 additions and 33 deletions

View File

@@ -1,28 +1,101 @@
---
kind: pipeline kind: pipeline
name: Opytex 2023-2024 name: Opytex Main
type: docker type: docker
trigger: trigger:
branch: branch:
- 2023-2024 - master
steps: steps:
- name: Deploy - name: Build Opytex base
image: python:3.8-alpine image: python:3.8-alpine
volumes:
- name: pelican-output
path: /output
commands: commands:
- apk add --no-cache openssh-client ca-certificates bash rsync git imagemagick-dev imagemagick - apk add --no-cache git imagemagick-dev imagemagick
- git submodule init - git submodule init
- git submodule update - git submodule update
- git clone https://git.opytex.org/lafrite/2021-2022.git content
- pip install --no-cache-dir -r requirements.txt - pip install --no-cache-dir -r requirements.txt
- export MAGICK_HOME=/usr - export MAGICK_HOME=/usr
- pelican ./content/ -o output -s publishconf.py --relative-urls - pelican ./content/ -o /output -s publishconf.py --relative-urls
- eval `ssh-agent -s` - ls /output
- echo "$SSH_KEY" | ssh-add -
- mkdir -p ~/.ssh - name: Push to bucket opytex.org
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config image: plugins/s3
- ssh sshcontent@91.121.90.228 'mkdir -p ~/opytex.org/www/enseignements/2021-2022/' volumes:
- rsync -rv --delete -e "ssh -p 22" ./output/ sshcontent@91.121.90.228:~/opytex.org/www/enseignements/2021-2022/ --checksum - name: pelican-output
environment: path: /output
SSH_KEY: settings:
from_secret: sshcontent-key bucket: opytex.org
endpoint: https://storage.opytex.org
access_key:
from_secret: minio_access_key
secret_key:
from_secret: minio_secret_key
source: /output/**/*
target: /
path_style: true
strip_prefix: /output
volumes:
- name: pelican-output
temp: {}
---
kind: pipeline
name: Opytex Year
type: docker
trigger:
branch:
- 2022-2023
- 2021-2022
- 2020-2021
- 2019-2020
- 2018-2019
- 2017-2018
- 2016-2017
- 2015-2016
steps:
- name: Build Opytex ${DRONE_BRANCH}
image: python:3.8-alpine
volumes:
- name: pelican-output
path: /output
commands:
- apk add --no-cache git imagemagick-dev imagemagick
- git submodule init
- git submodule update
- git clone https://git.opytex.org/lafrite/${DRONE_BRANCH}.git content
- pip install --no-cache-dir -r requirements.txt
- apk add --no-cache git imagemagick-dev imagemagick
- pip install --no-cache-dir -r requirements.txt
- export MAGICK_HOME=/usr
- pelican ./content/ -o /output -s publishconf.py --relative-urls
- ls /output
- name: Push to bucket opytex.org
image: plugins/s3-sync:1
volumes:
- name: pelican-output
path: /drone/src/output
settings:
bucket: opytex.org
endpoint: https://storage.opytex.org
access_key:
from_secret: minio_access_key
secret_key:
from_secret: minio_secret_key
source: /output
target: /enseignements/${DRONE_BRANCH}
path_style: true
delete: true
volumes:
- name: pelican-output
temp: {}

View File

@@ -0,0 +1,75 @@
name: Build and Deploy to MinIO
on:
push:
branches:
# - master
- 2025-2026
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- 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
- name: Install Python dependencies
run: |
pip install --no-cache-dir -r requirements.txt
- name: Setup content directory for year branches
if: gitea.ref != 'refs/heads/master'
run: |
BRANCH_NAME=${GITEA_REF_NAME}
if [ ! -L content ]; then
rm -rf content
git clone https://git.opytex.org/lafrite/${BRANCH_NAME}.git content
fi
- name: Build site
run: |
export MAGICK_HOME=/usr
pelican ./content/ -o ./output -s publishconf.py --relative-urls
- 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: gitea.ref == 'refs/heads/master'
run: |
mc mirror --overwrite --exclude "enseignements/*" ./output/ storage/$MINIO_BUCKET
- name: Deploy to MinIO - Year branches
env:
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
if: gitea.ref != 'refs/heads/master'
run: |
BRANCH_NAME=${GITEA_REF_NAME}
mc mirror --overwrite --remove ./output/ storage/$MINIO_BUCKET/enseignements/${BRANCH_NAME}/

0
__init__.py Normal file
View File

View File

@@ -10,7 +10,7 @@ from globalconf import *
AUTHOR = "Benjamin Bertrand" AUTHOR = "Benjamin Bertrand"
SITENAME = "OpyTex" SITENAME = "OpyTex"
SITETITLE = "OpyTex" SITETITLE = "OpyTex"
SITESUBTITLE = "2022-2023" SITESUBTITLE = "2025-2026"
SITEURL = "" SITEURL = ""
CC_LICENSE_COMMERCIAL = True CC_LICENSE_COMMERCIAL = True
@@ -50,7 +50,7 @@ PLUGINS = [
ALWAYS_MODIFIED = True ALWAYS_MODIFIED = True
# Mirror source structure # 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" ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html"
# USE_FOLDER_AS_CATEGORY = True # USE_FOLDER_AS_CATEGORY = True
@@ -93,5 +93,5 @@ AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None AUTHOR_FEED_RSS = None
# SOURCE LINK # SOURCE LINK
GIT_SOURCE_BASE_URL = "https://git.opytex.org/lafrite/2022-2023/src/branch/main" GIT_SOURCE_BASE_URL = "https://git.opytex.org/spazz/2022-2023/src/branch/main"
SOURCE_ICON_URL = "https://git.opytex.org/assets/img/logo.svg" SOURCE_ICON_URL = "https://git.opytex.org/assets/img/logo.svg"

View File

@@ -7,15 +7,17 @@ from __future__ import unicode_literals
import os import os
import sys import sys
sys.path.append(os.curdir) sys.path.append(os.curdir)
from pelicanconf import * from pelicanconf import *
# If your site is available via HTTPS, make sure SITEURL begins with https:// # 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 RELATIVE_URLS = False
FEED_ALL_ATOM = 'feeds/all.atom.xml' FEED_ALL_ATOM = "feeds/all.atom.xml"
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml"
DELETE_OUTPUT_DIRECTORY = True DELETE_OUTPUT_DIRECTORY = True

View File

@@ -1,15 +1,23 @@
anyio==4.10.0
beautifulsoup4==4.9.1 beautifulsoup4==4.9.1
blinker==1.4 blinker==1.9.0
bs4==0.0.1 bs4==0.0.1
docutils==0.16 docutils==0.22
feedgenerator==1.9.1 feedgenerator==2.2.1
Jinja2==2.11.2 idna==3.10
MarkupSafe==1.1.1 Jinja2==3.1.6
pelican==4.2.0 markdown-it-py==4.0.0
Pygments==2.6.1 MarkupSafe==3.0.2
python-dateutil==2.8.1 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 pytz==2020.1
six==1.15.0 rich==14.1.0
six==1.17.0
sniffio==1.3.1
soupsieve==2.0.1 soupsieve==2.0.1
Unidecode==1.1.1 Unidecode==1.4.0
Wand==0.6.2 Wand==0.6.2
watchfiles==1.1.0