43 lines
1.4 KiB
YAML
43 lines
1.4 KiB
YAML
clone:
|
|
git:
|
|
image: woodpeckerci/plugin-git
|
|
branch: develop
|
|
|
|
steps:
|
|
render-site:
|
|
image: registry.gitlab.com/quarto-forge/docker/rstats
|
|
commands:
|
|
- export XDG_CACHE_HOME=/tmp/quarto_cache_home
|
|
- export XDG_DATA_HOME=/tmp/quarto_data_home
|
|
- cd $CI_WORKSPACE
|
|
- quarto --no-home render
|
|
when:
|
|
event: [push, pull_request, cron, manual]
|
|
branch:
|
|
- develop
|
|
# 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:
|
|
- git config --global user.name "Woodpecker CI"
|
|
- git config --global user.email "git@polarolouis.fr"
|
|
- git clone -b main "https://$${ACCESS_TOKEN}@git.polarolouis.fr/polarolouis/synapses-carousel.git" $DESTINATION
|
|
- rm -rf $DESTINATION/* && echo "Cleaned $DESTINATION" || echo "Failed to clean $DESTINATION"
|
|
- cp -ar $CI_WORKSPACE/public/* $DESTINATION/
|
|
- cd $DESTINATION
|
|
- ls -la
|
|
- git add --all
|
|
- git commit -m "Deploy site $CI_BUILD_CREATED [CI SKIP]" || echo "Nothing to commit"
|
|
- git push && echo "Pushed to $DESTINATION" || echo "Failed to push to $DESTINATION"
|
|
environment:
|
|
ACCESS_TOKEN:
|
|
from_secret: access_token
|
|
DESTINATION: pages
|
|
when:
|
|
event: [push, pull_request, cron, manual]
|
|
branch:
|
|
- develop
|
|
depends_on:
|
|
- render-site
|