Files
log/.github/workflows/gh-pages-fast.yml
syui 2838e494d6 Update version to 0.1.3 and simplify version output
- Update Cargo.toml version to 0.1.3
- Custom version flag implementation to output version only
- Update GitHub Actions to handle simplified version output
- Update Gitea Actions (action.yml) for version handling
- Now `ailog -V` or `ailog --version` outputs just "0.1.3"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 17:12:04 +09:00

77 lines
2.3 KiB
YAML

name: github pages (fast)
on:
push:
branches:
- main
paths-ignore:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache ailog binary
uses: actions/cache@v4
with:
path: ./bin
key: ailog-bin-${{ runner.os }}
restore-keys: |
ailog-bin-${{ runner.os }}
- name: Check and update ailog binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get latest release version
LATEST_VERSION=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "Latest version: $LATEST_VERSION"
# Check current binary version if exists
mkdir -p ./bin
if [ -f "./bin/ailog" ]; then
CURRENT_VERSION=$(./bin/ailog --version 2>/dev/null || echo "unknown")
echo "Current version: $CURRENT_VERSION"
else
CURRENT_VERSION="none"
echo "No binary found"
fi
# Download if version is different or binary doesn't exist
if [ "$CURRENT_VERSION" != "${LATEST_VERSION#v}" ]; then
echo "Downloading ailog $LATEST_VERSION..."
curl -sL -H "Authorization: Bearer $GITHUB_TOKEN" \
https://github.com/${{ github.repository }}/releases/download/$LATEST_VERSION/ailog-linux-x86_64.tar.gz | tar -xzf -
mv ailog ./bin/ailog
chmod +x ./bin/ailog
echo "Updated to version: $(./bin/ailog --version 2>/dev/null)"
else
echo "Binary is up to date"
chmod +x ./bin/ailog
fi
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.139.2"
extended: true
- name: Build with ailog
env:
TZ: "Asia/Tokyo"
run: |
# Use pre-built ailog binary instead of cargo build
./bin/ailog build --output ./public
touch ./public/.nojekyll
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages