-
Notifications
You must be signed in to change notification settings - Fork 22
112 lines (106 loc) · 4.78 KB
/
build-icons-cd.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: build-icons-cd
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: 🛎 Check out master
uses: actions/checkout@v4.1.5
with:
fetch-depth: 1
path: ./iconos
- name: 🎩 Instalamos dependencias
working-directory: /tmp
run: |
echo "Configuramos la versión necesaria de Ruby (3.1.x)."
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
sudo apt remove ruby-build
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
git -C "$(rbenv root)"/plugins/ruby-build pull
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 3.1.6
rbenv global 3.1.6
echo "Instalamos mas dependencias."
sudo apt install libjpeg-dev libtiff5-dev libpng-dev libfreetype6-dev libgif-dev libgtk-3-dev libxml2-dev libpango1.0-dev libcairo2-dev libspiro-dev python3-dev ninja-build cmake build-essential gettext
sudo apt install zlib1g-dev
git clone https://github.com/fontforge/fontforge.git fontforge && cd fontforge && mkdir build && cd build && sudo cmake -GNinja .. && sudo ninja && sudo ninja install
cd ../../
git clone https://github.com/bramstein/sfnt2woff-zopfli.git sfnt2woff-zopfli && cd sfnt2woff-zopfli && make && mv sfnt2woff-zopfli /usr/local/bin/sfnt2woff
git clone --recursive https://github.com/google/woff2.git && cd woff2 && make clean all && sudo mv woff2_compress /usr/local/bin/ && sudo mv woff2_decompress /usr/local/bin/
sudo apt install jq
- name: 🎩 Instalamos Fontcustom
working-directory: ./iconos
run: |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv global 3.1.6
sudo gem install bundler fontcustom
sudo bundle install
- name: 🧹 Clean site
run: |
if [ -d "docs" ]; then
rm -rf docs/*
fi
- name: 🎩 Compilamos los íconos
working-directory: ./iconos
run: |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv global 3.1.6
sudo gem install bundler
bundle exec fontcustom compile -F
- name: 🔨 Instalamos dependencias para la documentación
working-directory: ./iconos
run: |
cp favicon.ico ./docs/.
mkdir -p dist/ilustraciones
cp -r src/_ilus/* dist/ilustraciones/.
- name: Descargamos la metadata y generamos el JSON
working-directory: ./docs
run: |
echo 'Descargamos de Google Sheets el JSON con la metadata'
wget -O ilus-google.json https://sheets.googleapis.com/v4/spreadsheets/13CLjNqMQlUXj849XYL_nGDaAkE90OOFT3mXL-Iag9xM/values/ilustraciones?alt=json&key=AIzaSyC4jEmhDrBl3bgEi6VEO4Ek5fl7vfHrQcQ
cat ilus-google.json | jq -r '.values as $vals |[ $vals[0] as $keys | $vals[1:][] | [ $keys, . ] | transpose | map({ (.[0]): .[1] }) | add ]' > ilus-arg.json
rm ilus-google.json
- name: 🧪 Deploy build
working-directory: ./iconos
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -am "🧪 Deploy with ${GITHUB_WORKFLOW}"
git push --all -f https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
- name: Checkout Poncho
uses: actions/checkout@v4.1.5
with:
repository: argob/poncho
ref: 'release-1.x'
path: ./poncho
- name: Copiamos archivos generados en el otro repo
run: |
echo "Copying..."
cp -R ./iconos/dist/css/icono-arg.css ./poncho/dist/css/
cp -R ./iconos/docs/icono-arg.json ./poncho/dist/jsons/icono-arg.json
- name: 🧪 Push Iconos Arg.
working-directory: ./poncho
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -am "🧪 Deploy iconos-arg with ${GITHUB_WORKFLOW}"
git push --all -f https://${{ secrets.GITHUB_TOKEN }}@github.com/argob/poncho.git
# - name: Push Project B
# run: |
# cd ./poncho
# git add .
# git config user.name "${GITHUB_ACTOR}"
# git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# git commit -am "File Replicated from Iconos"
# git push