Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebou12 committed Mar 12, 2024
2 parents 8822502 + a923ba3 commit 3672ac6
Show file tree
Hide file tree
Showing 8,649 changed files with 5,277 additions and 1,058,488 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 10 additions & 12 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- uses: oprypin/find-latest-tag@v1
with:
repository: clubcedille/algoets.etsmtl.ca
releases-only: true
id: octokit

- name: Increment Version
id: new_tag
run: |
Expand All @@ -51,15 +49,15 @@ jobs:
git push origin ${{ env.NEW_TAG }}
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
Expand All @@ -84,14 +82,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand All @@ -101,7 +99,7 @@ jobs:
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand All @@ -116,7 +114,7 @@ jobs:
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
theme
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"search.useIgnoreFiles": true
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:14 AS build
FROM node:20 AS build
WORKDIR /app

COPY . .
RUN npm install
RUN npm run build

FROM nginx:1.25.2-alpine
FROM nginx:1.25.3-alpine

COPY --from=build /app/theme /usr/share/nginx/html

Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

AlgoÉTS est le club de trading algorithmique de l'École de Technologie Supérieure (ÉTS). Nous nous concentrons sur l'utilisation des sciences de données et des technologies pour développer des stratégies de trading algorithmique.

```
npm i
npm run dev
```


## Fonctionnalités

- **Stratégies de Trading**: Développement et backtesting de stratégies de trading.
Expand All @@ -36,3 +42,25 @@ Nous organisons régulièrement des ateliers pour enseigner les bases du trading
## Projets en IA

Nous travaillons également sur des projets qui utilisent l'intelligence artificielle pour améliorer les algorithmes de trading et pour analyser le marché financier.

## Contribuer

Pour ajouter
une page de blog, simplement rédiger un nouveau fichier markdown sous le repertoire source/blog avec les frontmatters suivant :

```md
---
title: Votre titre
page-name: "Le nom de votre page"
background-image-url: "images/blog/lien/vers/image.jpg"
facebook-link :
twitter-link :
linkedin-link :
tags : [ "tag1", "tag2", "tag3"]
author : Nom autheur
author-title : Capitaine
author-role : Rôle
author-img : images/team/team-X.png
date : 1 janvier 2024
---
```
153 changes: 116 additions & 37 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ const fileinclude = require("gulp-file-include");
const autoprefixer = require("gulp-autoprefixer");
const bs = require("browser-sync").create();
const rimraf = require("rimraf");
const comments = require("gulp-header-comment");
const plumber = require('gulp-plumber');
const fs = require('fs');
const tap = require('gulp-tap');
const through = require('through2');
const frontMatter = require('gulp-front-matter');

async function getMarkdown() {
const markdown = await import('gulp-markdown');
return markdown.default;
}

var path = {
src: {
html: "source/*.html",
blog: "source/blog/*.md",
others: "source/*.+(php|ico|png)",
htminc: "source/partials/**/*.htm",
incdir: "source/partials/",
Expand All @@ -26,31 +36,114 @@ var path = {
},
};

let blogItemsIncludes = '';
// Blog
gulp.task("blog:build", async function () {
const markdown = await getMarkdown();
return gulp.src(path.src.blog)
.pipe(plumber())
.pipe(frontMatter())
.pipe(markdown())
.pipe(through.obj(function (file, enc, cb) {
this.push(file);
cb();
}, function (cb) {
if (this._transformState.writechunk) {
console.log('Processing Markdown file:', this._transformState.writechunk.relative);
}
cb();
}))
.pipe(tap(function (file) {
// Read the template
const template = fs.readFileSync('source/blog/blog_template.html', 'utf8');

const frontMatterData = file.frontMatter;
const title = frontMatterData.title || 'Default Title';
const pageName = frontMatterData['page-name'] || 'Default Page Name';
const bgImageUrl = frontMatterData['background-image-url'] || 'default-image.jpg';
const author = frontMatterData['author'] || 'AlgoÉTS';
const authorTitle = frontMatterData['author-title'] || 'Club';
const authorRole = frontMatterData['author-role'] || '.';
const authorImg = frontMatterData['author-img'] || 'default-image.jpg';
const facebookLink = frontMatterData['facebook-link'] || 'https://www.facebook.com/';
const twitterLink = frontMatterData['twitter-link'] || 'https://twitter.com/';
const linkedinLink = frontMatterData['linkedin-link'] || 'https://www.linkedin.com/';
const date = frontMatterData['date'];
const tagsHtml = frontMatterData['tags'].map(tag =>
`<li class="list-inline-item"><a href="#" rel="tag">${tag}</a></li>`
).join('\n');
const link = file.basename;


blogItemsIncludes += `
@@include('blocks/blog/blog-item.htm', {"image_src": "${bgImageUrl}", "date": "${date}", "title": "${title}", "summary": "${pageName}", "link": "${link}"})
`;

// Replace placeholders in the template
const htmlContent = template
.replace(/{{ title }}/g, title)
.replace(/{{ page-name }}/g, pageName)
.replace(/{{ background-image-url }}/g, bgImageUrl)
.replace(/{{ author }}/g, author)
.replace(/{{ author-title }}/g, authorTitle)
.replace(/{{ author-role }}/g, authorRole)
.replace(/{{ author-img }}/g, authorImg)
.replace(/{{ facebook-link }}/g, facebookLink)
.replace(/{{ twitter-link }}/g, twitterLink)
.replace(/{{ linkedin-link }}/g, linkedinLink)
.replace(/{{ tags }}/g, `<ul class="list-inline">${tagsHtml}</ul>`)
.replace(/{{ content }}/g, file.contents.toString());

// Update the file content
file.contents = Buffer.from(htmlContent);
}))
.pipe(fileinclude({
basepath: path.src.incdir,
}))
.pipe(gulp.dest(path.build.dirDev))
.pipe(bs.reload({
stream: true,
}));
});
// HTML
gulp.task("html:build", function () {
return gulp
.src(path.src.html)
.pipe(
fileinclude({
basepath: path.src.incdir,
})
)
.pipe(
comments(`
WEBSITE: https://themefisher.com
TWITTER: https://twitter.com/themefisher
FACEBOOK: https://www.facebook.com/themefisher
GITHUB: https://github.com/themefisher/
`)
)
.pipe(plumber({
errorHandler: function (err) {
console.error('Error in plugin "' + err.plugin + '": ' + err.message);
this.emit('end');
}
}))
.pipe(through.obj(function (file, enc, cb) {
// Check if the file is blog-grid.html
if (file.basename === 'blog-grid.html') {
// Replace {{ blogList }} with blogItemsIncludes
let fileContent = file.contents.toString();
fileContent = fileContent.replace('{{ blogList }}', blogItemsIncludes);
file.contents = Buffer.from(fileContent);
}

this.push(file);
cb();
}, function (cb) {
if (this._transformState.writechunk) {
console.log('Processing file:', this._transformState.writechunk.relative);
}
cb();
}))
.pipe(fileinclude({
basepath: path.src.incdir,
}))
.pipe(gulp.dest(path.build.dirDev))
.pipe(
bs.reload({
stream: true,
})
);
.pipe(bs.reload({
stream: true,
}));
});

gulp.task("blog-and-html:build", gulp.series("blog:build", "html:build"));


// SCSS
gulp.task("scss:build", function () {
return gulp
Expand All @@ -63,14 +156,6 @@ gulp.task("scss:build", function () {
)
.pipe(autoprefixer())
.pipe(sourcemaps.write("/"))
.pipe(
comments(`
WEBSITE: https://themefisher.com
TWITTER: https://twitter.com/themefisher
FACEBOOK: https://www.facebook.com/themefisher
GITHUB: https://github.com/themefisher/
`)
)
.pipe(gulp.dest(path.build.dirDev + "css/"))
.pipe(
bs.reload({
Expand All @@ -83,14 +168,6 @@ gulp.task("scss:build", function () {
gulp.task("js:build", function () {
return gulp
.src(path.src.js)
.pipe(
comments(`
WEBSITE: https://themefisher.com
TWITTER: https://twitter.com/themefisher
FACEBOOK: https://www.facebook.com/themefisher
GITHUB: https://github.com/themefisher/
`)
)
.pipe(gulp.dest(path.build.dirDev + "js/"))
.pipe(
bs.reload({
Expand Down Expand Up @@ -136,6 +213,8 @@ gulp.task("clean", function (cb) {
// Watch Task
gulp.task("watch:build", function () {
gulp.watch(path.src.html, gulp.series("html:build"));
gulp.watch(path.src.blog, gulp.series("blog:build"));
gulp.watch(path.src.blog, gulp.series("blog-and-html:build"));
gulp.watch(path.src.htminc, gulp.series("html:build"));
gulp.watch(path.src.scss, gulp.series("scss:build"));
gulp.watch(path.src.js, gulp.series("js:build"));
Expand All @@ -148,7 +227,7 @@ gulp.task(
"default",
gulp.series(
"clean",
"html:build",
"blog-and-html:build",
"js:build",
"scss:build",
"images:build",
Expand All @@ -168,7 +247,7 @@ gulp.task(
gulp.task(
"build",
gulp.series(
"html:build",
"blog-and-html:build",
"js:build",
"scss:build",
"images:build",
Expand Down
1 change: 0 additions & 1 deletion node_modules/.bin/acorn

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/atob

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/autoprefixer

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/browser-sync

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/browserslist

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/color-support

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/dev-ip

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/gulp

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/json5

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/lt

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/mime

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/nanoid

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/resolve

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/rimraf

This file was deleted.

Loading

0 comments on commit 3672ac6

Please sign in to comment.