update deploy to use pages
All checks were successful
Deploy to Git-Pages / build-and-deploy (push) Successful in 16s

This commit is contained in:
2026-03-10 06:29:01 +00:00
parent 63c541c78c
commit bd5eb67045

View File

@@ -1,4 +1,4 @@
name: Deploy Hugo to Gitea Pages
name: Deploy to Git-Pages
on:
push:
branches:
@@ -8,30 +8,40 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Build Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true # <--- THIS IS THE MISSING KEY
extended: true
- name: Run Build
- name: Build Hugo
run: hugo --minify
- name: Upload to Gitea Pages
# Use v3 instead of v4
uses: actions/upload-artifact@v3
with:
name: github-pages # Gitea pages expects this specific name
path: 'public/'
- name: Deploy to 'pages' branch
run: |
# 1. Configure Git
git config --global user.name "Gitea Actions"
git config --global user.email "actions@gitea.com"
- name: Deploy to Pages Branch
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }} # You'll need to create this in Gitea
publish_branch: pages
publish_dir: ./public
# 2. Prepare the directory for a fresh branch
# We move the contents of 'public' into a temporary folder
mkdir ../temp_pages
cp -r public/* ../temp_pages/
# 3. Initialize a new git repository in the temp folder
cd ../temp_pages
git init
git checkout -b pages
# 4. Add files and commit
git add .
git commit -m "Deploy from Gitea Actions"
# 5. Push to the pages branch
# We use your personal access token (PAT) for authentication
git push --force https://oauth2:${{ secrets.ACCESS_TOKEN }}@git.wompmacho.com/${{ github.repository }}.git pages