Skip to content

ci: testing

ci: testing #20

Workflow file for this run

name: Deploy Jekyll site to Pages
on:
push:
branches: ["main", "gh-pages"]
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@8575951200e472d5f2d95c625da0c7bec8217c42
with:
ruby-version: '3.1'
bundler-cache: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
run: bundle exec jekyll build --destination _site/en --baseurl "${{ steps.pages.outputs.base_path }}/en"
env:
JEKYLL_ENV: production
- name: Set lang to de
run: |
sed -i "/^lang:/c\lang: de" _config.yml
if ! grep -q "^lang:" _config.yml; then
echo "lang: de" >> _config.yml
fi
- name: Build with Jekyll
run: bundle exec jekyll build --destination _site/de --baseurl "${{ steps.pages.outputs.base_path }}/de"
env:
JEKYLL_ENV: production
- name: Set lang to es
run: |
sed -i "/^lang:/c\lang: es" _config.yml
if ! grep -q "^lang:" _config.yml; then
echo "lang: es" >> _config.yml
fi
- name: Build with Jekyll
run: bundle exec jekyll build --destination _site/es --baseurl "${{ steps.pages.outputs.base_path }}/es"
env:
JEKYLL_ENV: production
- name: Create index.html
run: |
echo '<!DOCTYPE html>' > index.html
echo '<html lang="en">' >> index.html
echo '<head>' >> index.html
echo ' <meta charset="UTF-8">' >> index.html
echo ' <meta name="viewport" content="width=device-width, initial-scale=1.0">' >> index.html
echo ' <title>Welcome to Our Multilingual Site</title>' >> index.html
echo '</head>' >> index.html
echo '<body>' >> index.html
echo ' <h1>Welcome to Our Multilingual Site</h1>' >> index.html
echo ' <ul>' >> index.html
echo ' <li><a href="../de/">Deutsch</a></li>' >> index.html
echo ' <li><a href="../en/">English</a></li>' >> index.html
echo ' <li><a href="../es/">Español</a></li>' >> index.html
echo ' </ul>' >> index.html
echo '</body>' >> index.html
echo '</html>' >> index.html
mv index.html _site/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}