Merge pull request #46 from argob/req#16460-modificaciones-ilustraciones #201
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-icons-cd | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: 🛎 Check out Iconos masters | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
# path: ./iconos | |
ref: master | |
# - name: 🎩 Instalamos dependencias Ruby 3.1 | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' # Not needed with a .ruby-version file | |
- name: Install dependencies | |
run: bundle install | |
- name: 🎩 Instalamos dependencias | |
working-directory: /tmp | |
run: | | |
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 | |
cd /tmp | |
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 && sudo mv sfnt2woff-zopfli /usr/local/bin/sfnt2woff | |
cd ../ | |
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: | | |
gem install bundler fontcustom | |
bundle install | |
- name: 🧹 Clean site | |
run: | | |
if [ -d "docs" ]; then | |
rm -rf docs/* | |
fi | |
- name: 🎩 Compilamos los íconos | |
# working-directory: ./iconos | |
run: | | |
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/_ilustraciones/* dist/ilustraciones/. | |
- name: Descargamos la metadata y generamos el JSON | |
# working-directory: ./iconos | |
run: | | |
echo 'Descargamos de Google Sheets el JSON con la metadata' | |
wget -O ./docs/ilus-google.json 'https://sheets.googleapis.com/v4/spreadsheets/13CLjNqMQlUXj849XYL_nGDaAkE90OOFT3mXL-Iag9xM/values/ilustraciones?alt=json&key=AIzaSyC4jEmhDrBl3bgEi6VEO4Ek5fl7vfHrQcQ' | |
cat ./docs/ilus-google.json | jq -r '.values as $vals |[ $vals[0] as $keys | $vals[1:][] | [ $keys, . ] | transpose | map({ (.[0]): .[1] }) | add ]' > ./docs/ilus-arg.json | |
rm ./docs/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 | |
with: | |
repository: argob/poncho | |
ref: 'release-1.x' | |
path: ./poncho | |
- name: Copiamos archivos generados en el otro repo | |
run: | | |
echo "Copying..." | |
cp -R ./dist/css/icono-arg.css ./poncho/dist/css/ | |
cp -R ./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 |