doc: 📝 Quarkus langchain4j streaming #397
Workflow file for this run
This file contains 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: Jekyll site CI | |
on: | |
# Dès qu'une activité sur la PR ciblant la master est détectée on déclenche le workflow | |
pull_request: | |
branches: [ master ] | |
jobs: | |
create_env: | |
# Ce job doit créer le site si il n'existe pas | |
name: Site creation on netlify | |
runs-on: ubuntu-latest | |
outputs: | |
# Cet output servira au job de déploiement du site sur Netlify | |
site-id: ${{ steps.create-site.outputs.site-id }} | |
steps: | |
- id: create-site | |
# Step permettant la création d'un site Netlify avec comme nom le nom de la branche ciblé par la PR | |
# Il permet aussi de récupérer le site_id pour le futur déploiement. | |
name: Create Site | |
run: | | |
SITE_ID=$(curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.NETLIFY_AUTH_TOKEN }}" https://api.netlify.com/api/v1/sites?name=${{github.head_ref}} | jq --raw-output '.[0].id') | |
if [ $SITE_ID == 'null' ]; | |
then | |
echo "Site inexistant" | |
SITE_ID=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.NETLIFY_AUTH_TOKEN }}" -d '{"name": "${{github.head_ref}}"}' https://api.netlify.com/api/v1/sites | jq --raw-output '.id') | |
fi | |
if [ $SITE_ID == 'null' ]; | |
then | |
return -1 | |
fi | |
echo "::set-output name=site-id::$SITE_ID" | |
jekyll: | |
needs: create_env | |
# Ce job permet de construire et déployer le site Jekyll | |
name: Build and deploy Jekyll site | |
runs-on: ubuntu-latest | |
steps: | |
# Récupération des sources | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Mise en cache des dépendances Ruby | |
- uses: actions/cache@v2 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
# Build du site Jekyll | |
- name: Build | |
uses: lemonarc/[email protected] | |
# Déploiement sur Netlify | |
- name: Deploy to Netlify | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: './_site' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Deploy from GitHub Actions : ${{ github.event.pull_request.title }}" | |
enable-pull-request-comment: true | |
enable-commit-comment: true | |
overwrites-pull-request-comment: true | |
alias: ${{ github.head_ref }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
# Réutilisation de l'identifiant du site précédemment créé | |
NETLIFY_SITE_ID: ${{needs.create_env.outputs.site-id }} | |
timeout-minutes: 1 | |