Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9aa0e21aa | ||
|
|
42e7b8f93f | ||
|
|
6647487bcb | ||
|
|
181411f40a |
1 changed files with 9 additions and 28 deletions
|
|
@ -8,38 +8,19 @@ steps:
|
|||
when:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
branch:
|
||||
- main
|
||||
# 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
|
||||
image: curlimages/curl:8.5.0
|
||||
commands:
|
||||
- git config --global --add safe.directory /woodpecker/src/git.polarolouis.fr/polarolouis/site-perso
|
||||
- git config --global --add safe.directory /woodpecker/src/git.polarolouis.fr/polarolouis/pages
|
||||
- git config --global user.name "Woodpecker CI"
|
||||
- git config --global user.email "git@polarolouis.fr"
|
||||
- cd /woodpecker/src/git.polarolouis.fr/polarolouis/
|
||||
- git clone "https://git.polarolouis.fr/polarolouis/pages.git"
|
||||
- rm -rf pages/*
|
||||
- cp -r site-perso/public/* pages/
|
||||
- cp site-perso/.domains pages/
|
||||
- cd pages
|
||||
- ls -la
|
||||
- git remote set-url origin "https://$${ACCESS_TOKEN}@git.polarolouis.fr/polarolouis/pages.git"
|
||||
- git add --all
|
||||
- git commit -m "Deploy site [CI SKIP]"
|
||||
- git push -f origin main
|
||||
environment:
|
||||
ACCESS_TOKEN:
|
||||
from_secret: access_token
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
branch:
|
||||
- main
|
||||
- tar -czf /tmp/site.tar.gz -C /woodpecker/src/git.polarolouis.fr/polarolouis/site-perso/public .
|
||||
- |
|
||||
curl -f -X POST https://pages.polarolouis.fr/api/pages \
|
||||
-F "domain=polarolouis.pages.polarolouis.fr" \
|
||||
-F "file=@/tmp/site.tar.gz"
|
||||
depends_on:
|
||||
- render-site
|
||||
when:
|
||||
branch: main
|
||||
event: push
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue