From a269572d4bf81039c59e6d283b6b99c0ffdae6e4 Mon Sep 17 00:00:00 2001 From: maiwann Date: Mon, 10 Feb 2025 14:50:26 +0100 Subject: [PATCH 1/5] Add files via upload --- Gemfile | 43 +++++++++++++++++++++++++++++++++++++++++++ _config.yml | 10 +++++++++- gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ ruby-version | 1 + 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 Gemfile create mode 100644 gitlab-ci.yml create mode 100644 ruby-version diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..0848b7d --- /dev/null +++ b/Gemfile @@ -0,0 +1,43 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 4.3.2" + +# Jekyll theme for Scribouilli +gem "mimoza", git: "https://github.com/Scribouilli/mimoza.git", branch: "main" + +group :jekyll_plugins do + gem "jekyll-git-hash", "~> 0.1.1" + + # Handle redirections + gem "jekyll-redirect-from", "~> 0.16" + + # Atom feed on Jekyll posts + gem "jekyll-feed", "~> 0.17" + + # Pagination + gem "jekyll-paginate-v2", "~> 3.0" + + # SEO tags + gem "jekyll-seo-tag", "~> 2.8" + + # Generate a sitemap + gem "jekyll-sitemap", "~> 1.4" + + # Enable Jekyll to read custom YAML front matter + gem "jekyll-optional-front-matter", "~> 0.3" + + # Add default layouts to pages and posts + gem "jekyll-default-layout", "~> 0.1.5" + + # Generate default titles from headings + gem "jekyll-titles-from-headings", "~> 0.5.3" +end + +group :development do + gem "dotenv", "~> 2.7" + gem "webrick", "~> 1.7" +end + +group :test do + gem 'rspec' +end diff --git a/_config.yml b/_config.yml index 694a820..05c872e 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1,9 @@ -remote_theme: scribouilli/mimoza \ No newline at end of file +collections: + projects: + output: true +plugins: + - jekyll-feed + - jekyll-git-hash +theme: mimoza +scribouilli: true +baseurl: /fichiers_pour_maia diff --git a/gitlab-ci.yml b/gitlab-ci.yml new file mode 100644 index 0000000..3a7e46b --- /dev/null +++ b/gitlab-ci.yml @@ -0,0 +1,31 @@ +default: + image: ruby:3.2.2 + cache: + - key: + files: + - Gemfile.lock + paths: + - vendor/bundle + before_script: + - gem install bundler + - bundle config set --local path "vendor/bundle" + - bundle install + +stages: + - deploy + + +pages: + stage: deploy + variables: + JEKYLL_ENV: production + LC_ALL: C.UTF-8 + script: + - bundle exec jekyll build -d public + - gzip -k -9 $(find public -iname '*.html' -o -iname '*.css' -o -iname '*.js' -o -iname '*.json') || true + artifacts: + paths: + - public + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH + diff --git a/ruby-version b/ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/ruby-version @@ -0,0 +1 @@ +3.2.2 From d370c04df7b2f6d91b1b03afc1e51c0237d695bb Mon Sep 17 00:00:00 2001 From: maiwann Date: Mon, 10 Feb 2025 14:50:51 +0100 Subject: [PATCH 2/5] Rename gitlab-ci.yml to .gitlab-ci.yml --- gitlab-ci.yml => .gitlab-ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gitlab-ci.yml => .gitlab-ci.yml (100%) diff --git a/gitlab-ci.yml b/.gitlab-ci.yml similarity index 100% rename from gitlab-ci.yml rename to .gitlab-ci.yml From 0d6d86ef291ec24fb6385be7aea537cd152bb3c3 Mon Sep 17 00:00:00 2001 From: maiwann Date: Mon, 10 Feb 2025 14:51:16 +0100 Subject: [PATCH 3/5] Rename ruby-version to .ruby-version --- ruby-version => .ruby-version | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ruby-version => .ruby-version (100%) diff --git a/ruby-version b/.ruby-version similarity index 100% rename from ruby-version rename to .ruby-version From 6803bf336b8bac87744adb9c178649ca8682bf74 Mon Sep 17 00:00:00 2001 From: maiwann Date: Mon, 10 Feb 2025 14:55:16 +0100 Subject: [PATCH 4/5] Create build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..09c2986 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,66 @@ +# This config is inspired by https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml + +name: Deploy Scribouilli site to GitHub Pages with a custom theme + +on: + push: + repository_dispatch: + types: atelier-scribouilli + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + # cf. https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable + # Run job only on default branch (as $default_branch variable only works on + # workflow templates) + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 # Per recommandation https://github.com/ruby/setup-ruby?tab=readme-ov-file#versioning + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 1 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Install dependencies + run: bundle install + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: bundle exec jekyll build + env: + JEKYLL_ENV: production + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v3 + + # Deployment job + deploy: + # cf. https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable + # Run job only on default branch (as $default_branch variable only works on + # workflow templates) + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From c0ba80afb1ab93a3e6c16f8c399d078b8ff79bc2 Mon Sep 17 00:00:00 2001 From: maiwann Date: Mon, 10 Feb 2025 14:55:41 +0100 Subject: [PATCH 5/5] enleve le mauvais baseurl --- _config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/_config.yml b/_config.yml index 05c872e..532b2bd 100644 --- a/_config.yml +++ b/_config.yml @@ -6,4 +6,3 @@ plugins: - jekyll-git-hash theme: mimoza scribouilli: true -baseurl: /fichiers_pour_maia