Compare commits
13 Commits
251d637a7b
...
2025-2026
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e3af32f41 | |||
| bcd9480e66 | |||
| 4c22c889bf | |||
| fbd7a0ce54 | |||
| 5e5a40eebe | |||
| 5d81ca35c5 | |||
| 1aede656fa | |||
| 3c9feb0cf5 | |||
| ec8d4d23b7 | |||
| 7577854064 | |||
| 9e8d523de1 | |||
| 03290ee848 | |||
| be17a9952c |
101
.drone.yml
101
.drone.yml
@@ -1,101 +0,0 @@
|
||||
---
|
||||
kind: pipeline
|
||||
name: Opytex Main
|
||||
type: docker
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: Build Opytex base
|
||||
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
|
||||
- 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
|
||||
volumes:
|
||||
- name: pelican-output
|
||||
path: /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: /
|
||||
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: {}
|
||||
@@ -7,9 +7,12 @@ on:
|
||||
- 2025-2026
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
branch-type: ${{ steps.branch-info.outputs.branch-type }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -17,6 +20,15 @@ jobs:
|
||||
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:
|
||||
@@ -25,26 +37,46 @@ jobs:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y imagemagick libmagickwand-dev
|
||||
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: |
|
||||
BRANCH_NAME=${GITEA_REF_NAME}
|
||||
if [ ! -L content ]; then
|
||||
rm -rf content
|
||||
git clone https://git.opytex.org/lafrite/${BRANCH_NAME}.git content
|
||||
fi
|
||||
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
|
||||
@@ -62,14 +94,14 @@ jobs:
|
||||
- name: Deploy to MinIO - Master branch
|
||||
env:
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
if: gitea.ref == 'refs/heads/master'
|
||||
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 }}
|
||||
if: gitea.ref != 'refs/heads/master'
|
||||
BRANCH_NAME: ${{ gitea.ref_name }}
|
||||
if: needs.build.outputs.branch-type == 'year'
|
||||
run: |
|
||||
BRANCH_NAME=${GITEA_REF_NAME}
|
||||
mc mirror --overwrite --remove ./output/ storage/$MINIO_BUCKET/enseignements/${BRANCH_NAME}/
|
||||
|
||||
@@ -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 = "2025-2026"
|
||||
SITESUBTITLE = YEAR
|
||||
SITEURL = ""
|
||||
|
||||
CC_LICENSE_COMMERCIAL = True
|
||||
@@ -93,5 +94,5 @@ AUTHOR_FEED_ATOM = None
|
||||
AUTHOR_FEED_RSS = None
|
||||
|
||||
# SOURCE LINK
|
||||
GIT_SOURCE_BASE_URL = "https://git.opytex.org/spazz/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"
|
||||
|
||||
Reference in New Issue
Block a user