Add TR/EN bilingual support via jekyll-polyglot + GitHub Actions #1
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: Build and Deploy Jekyll Site | |
| on: | |
| push: | |
| branches: ["master"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Build TR site (default language) | |
| run: bundle exec jekyll build --config _config.yml | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Build EN site | |
| run: | | |
| bundle exec jekyll build \ | |
| --config _config.yml,_config.en.yml \ | |
| --destination _site_en | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Merge EN build into TR build | |
| run: | | |
| if [ -d "_site_en/en" ]; then | |
| cp -r _site_en/en _site/en | |
| fi | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: '_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 |