Skip to content

Hugo Blog

Hugo Blog #40

Workflow file for this run

name: CI
run-name: Hugo Blog
on:
push:
jobs:
build:
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Checkout the current branch
uses: actions/checkout@v3
- name: Initialize the ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install Hugo
run: sudo snap install hugo
- name: Build the website
run: hugo
- name: install bs4
run: pip install bs4
- name: run bs4 command
run: python3 utils/calculate_size.py --directory public/ --baseURL http://marceloexc.com
- name: Scan the host key
run: mkdir -p ~/.ssh/ && ssh-keyscan -H $DEPLOY_SERVER >> ~/.ssh/known_hosts
env:
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }}
- name: Deploy the website
run: >-
rsync -avx --delete --exclude '.ssh' public/ $DEPLOY_USERNAME@$DEPLOY_SERVER:./
env:
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }}
DEPLOY_USERNAME: ${{ secrets.DEPLOY_USERNAME }}
# - name: Change URL for CORS on non-SSL mirror Hugo Config
# run: sudo rm -rf hugo.toml && mv hugo_infinityfree.toml hugo.toml
#
# - name: Build the website (again)
# run: hugo
#
# - name: 🚚 Get latest code
# uses: actions/checkout@v4
#
# - name: 📂 Sync files
# uses: SamKirkland/[email protected]
# with:
# server: ftpupload.net
# username: ${{ secrets.FTP_USERNAME }}
# password: ${{ secrets.FTP_PASSWORD }}
# local-dir: ./public/
# server-dir: .htdocs/
# exclude: |
# *.ssh*