Deploy Jekyll site to Pages #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Jekyll site to Pages | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - 'docs/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: 'pages' | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Installe Ruby ET les dépendances du Gemfile en une seule étape | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| # Configure l'URL de base pour GitHub Pages | |
| - name: Setup GitHub Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| # Construit le site depuis la racine du projet | |
| - name: Build Jekyll site | |
| run: bundle exec jekyll build --source ./docs --destination ./docs/_site --baseurl "${{ steps.pages.outputs.base_path }}" | |
| env: | |
| JEKYLL_ENV: production | |
| # Met en ligne l'artefact construit | |
| - name: Upload artifact to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_site/ | |
| deploy: | |
| 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 |