blog-bitix-deploy #248
Workflow file for this run
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: blog-bitix-deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: 0.121.1 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: master | |
- uses: actions/checkout@v4 | |
with: | |
path: deploy/ | |
ref: gh-pages | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Environment information | |
run: | | |
uname -a | |
lsb_release -a | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
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@v2 | |
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 .. | |