generated from JJ/plantilla-IV
-
Notifications
You must be signed in to change notification settings - Fork 31
49 lines (48 loc) · 1.45 KB
/
commit-json.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "Genera ficheros de datos"
on:
push:
branches:
- master
paths:
- proyectos/objetivo*.md
- lib/**
- t/**
- .github/workflows/commit-json.yaml
jobs:
genera-objetivos:
runs-on: ubuntu-latest
permissions:
contents: write
container:
image: ghcr.io/jj/raku-github-actions
env:
GITHUB_SECRETS: ${{secrets.GITHUB_TOKEN}}
steps:
- name: Checkout this
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache para las distros instaladas
uses: actions/cache@v3
id: meta6
with:
path: /home/raku/.raku/
key: ${{ runner.os }}-${{ hashFiles('META6.json') }}
- name: Instala módulos Raku
if: steps.meta6.outputs.cache-hit != 'true'
continue-on-error: true
run: HOME=/home/raku zef install --deps-only .
- name: Genera JSON
run: raku -Ilib scripts/iv-objetivos.raku > data/objetivos.json
- name: Genera fechas de entrega
run: raku -Ilib scripts/iv-fechas-csv.raku > data/fechas-entrega.csv
- name: Sube JSON actualizado
run: |
if [ -n "$(git status -s)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "IVDataBot"
git commit -am ":arrow_up: Actualiza datos"
git push
else
echo "🟏 No ha habido cambios"
fi