www/.forgejo/workflows/ci.yaml

69 lines
2.0 KiB
YAML
Raw Permalink Normal View History

2023-10-20 11:40:47 +02:00
on:
push:
branches:
- 'master'
jobs:
synchro:
runs-on: linux_amd64
steps:
- name: Retrieve files
shell: bash
run: |
git clone ${{ gitea.server_url }}/${{ gitea.repository }} www
- name: Synchronize files
shell: bash
run: |
cd www
rsync -avzlh . /home/webmaster/site-a-lec.org/articles --exclude=".[!.]*" --filter='P sidebar/*' --delete
echo $(git diff-tree --no-commit-id --name-only -r master | grep stl || find . -name "*.stl" -printf "%P\n") > /home/webmaster/site-a-lec.org/.modified
- run: echo "Job ended with status '${{ job.status }}'."
tests:
2023-10-28 18:26:00 +02:00
needs: synchro
2023-10-20 11:40:47 +02:00
runs-on: linux_amd64
steps:
- name: Syntax & validity checks
shell: bash
run: |
cd /home/webmaster/site-a-lec.org
files=$(cat .modified)
if [ -z "$files" ]; then
files=$(find . -name "*.stl" -printf %P)
fi
errors=0
for file in $files
do
echo "### Test de $file"
stl log clean
stl check $file -F | grep -e "Err" -e "erreur de" -e "Aucun fichier" && errors=$((errors+1)) # error if err is read in standard output
done
[ $errors -gt 0 ] && false
true
deploiement:
2023-10-28 18:26:00 +02:00
needs: tests
2023-10-20 11:40:47 +02:00
runs-on: linux_amd64
steps:
- name: Build html files
shell: bash
run: |
cd /home/webmaster/site-a-lec.org
files=$(cat .modified)
if [ -z "$files" ]; then
files=$(find . -name "*.stl" -printf %P)
fi
errors=0
for file in $files
do
echo "Construction de $file"
stl log clean
stl wip $file -F | grep -e "Err" -e "erreur de" -e "Aucun fichier" && errors=$((errors+1)) # error if err is read in standard output
done
[ $errors -gt 0 ] && false
true
- name: Rebuild the sidebar
shell: bash
2023-10-25 00:42:42 +02:00
run: |
stl sidebar load