Skip to content

Merge pull request #11 from gioelelm/claude/fix-profile-grammar-FqH97 #84

Merge pull request #11 from gioelelm/claude/fix-profile-grammar-FqH97

Merge pull request #11 from gioelelm/claude/fix-profile-grammar-FqH97 #84

Workflow file for this run

name: Deploy Hugo Site
on:
push:
branches:
- dev
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout dev branch
uses: actions/checkout@v4
with:
ref: dev
submodules: recursive
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download Hugo 0.53
run: |
wget -q https://github.com/gohugoio/hugo/releases/download/v0.53/hugo_0.53_Linux-64bit.tar.gz
tar -xzf hugo_0.53_Linux-64bit.tar.gz
chmod +x hugo
./hugo version
- name: Build Hugo site
run: ./hugo
- name: Deploy to master branch
run: |
# Configure git
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# Create worktree for master branch (separate directory, no conflicts)
git worktree add /tmp/gh-pages master
# Remove all files except .git
cd /tmp/gh-pages
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' -exec rm -rf {} +
# Copy built site
cp -r $GITHUB_WORKSPACE/public/* .
# Commit and push
git add -A
git commit -m "Deploy from dev - $(date '+%Y-%m-%d %H:%M:%S')" || echo "No changes"
git push origin master
# Cleanup
cd $GITHUB_WORKSPACE
git worktree remove --force /tmp/gh-pages