Skip to content

Pequeños retoques #322

Pequeños retoques

Pequeños retoques #322

name: blog-bitix-deploy
on:
push:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.135.0
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: actions/checkout@v4
with:
path: deploy/
ref: gh-pages
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Environment information
run: |
uname -a
lsb_release -a
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Cache hugo resources
uses: actions/cache@v4
env:
cache-name: cache-hugo-resources
with:
path: ./resources
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install packages (hugo)
run: |
wget https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
tar xzf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz hugo
rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
chmod +x ./hugo
sudo mv ./hugo /usr/local/bin
- name: Install packages (npm)
run: |
npm install
- name: Echo content
run: |
ls
- name: Echo content (deploy)
run: |
ls deploy/
- name: Generate styles
run: |
npm run less-main
hugo gen chromastyles --style=github > themes/bitix/static/assets/css/syntax.css
- name: Generate content
run: |
hugo --destination="deploy/" --gc --cleanDestinationDir
- name: Generate content (fixes)
run: |
cp deploy/index.xml deploy/atom.xml
mkdir -p deploy/categories/planeta-codigo/
cp deploy/tags/planeta-codigo/index.xml deploy/categories/planeta-codigo/atom.xml
- name: Echo content (deploy)
run: |
ls deploy/
- name: Deploy
run: |
cd deploy/
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Site update at `LC_ALL=en_US.utf8 date +%Y-%m-%dT%H:%M:%S%z`"
git push origin gh-pages
cd ..