This commit is contained in:
parent
29d2bae9d8
commit
ee71f21c2e
1 changed files with 63 additions and 0 deletions
|
|
@ -0,0 +1,63 @@
|
||||||
|
# La CI va :
|
||||||
|
# - Cloner le dépôt `site-perso`
|
||||||
|
# - Render le site avec quarto
|
||||||
|
# - Push le contenu du dossier public sur le dépôt `pages` de git.polarolouis.fr
|
||||||
|
|
||||||
|
steps:
|
||||||
|
clone-site:
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- git clone "$DEPOT_SITE_PERSO" site-perso
|
||||||
|
environment:
|
||||||
|
SSH_PRIVATE_KEY:
|
||||||
|
from_secret: SSH_PRIVATE_KEY
|
||||||
|
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
|
||||||
|
render-site:
|
||||||
|
image: quarto-dev/quarto-cli
|
||||||
|
commands:
|
||||||
|
- cd site-perso
|
||||||
|
- quarto render
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
depends_on:
|
||||||
|
- clone-site
|
||||||
|
# Push le contenu du dossier public sur le dépôt `pages` de git.polarolouis.fr
|
||||||
|
# On utilise l'image alpine/git pour avoir git et ssh
|
||||||
|
|
||||||
|
deploy-site:
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- cd site-perso/public
|
||||||
|
- git init
|
||||||
|
- git config user.name "CI Bot"
|
||||||
|
- git config user.email "ci@example.com"
|
||||||
|
- git remote add origin "$DEPOT_PAGES"
|
||||||
|
- git add .
|
||||||
|
- git commit -m "Deploy site"
|
||||||
|
- git push -f origin main
|
||||||
|
environment:
|
||||||
|
DEPOT_SITE_PERSO: git@git.polarolouis.fr:2220:polarolouis/site-perso.git
|
||||||
|
DEPOT_PAGES: git@git.polarolouis.fr:polarolouis/pages.git
|
||||||
|
SSH_PRIVATE_KEY:
|
||||||
|
from_secret: SSH_PRIVATE_KEY
|
||||||
|
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
depends_on:
|
||||||
|
- clone-site
|
||||||
|
- render-site
|
||||||
Loading…
Add table
Reference in a new issue