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 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 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..532b2bd 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1,8 @@ -remote_theme: scribouilli/mimoza \ No newline at end of file +collections: + projects: + output: true +plugins: + - jekyll-feed + - jekyll-git-hash +theme: mimoza +scribouilli: true