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: on:
push: push:
branches: branches:
@@ -8,30 +8,40 @@ jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Build Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v3 uses: peaceiris/actions-hugo@v3
with: with:
hugo-version: 'latest' hugo-version: 'latest'
extended: true # <--- THIS IS THE MISSING KEY extended: true
- name: Run Build - name: Build Hugo
run: hugo --minify run: hugo --minify
- name: Upload to Gitea Pages - name: Deploy to 'pages' branch
# Use v3 instead of v4 run: |
uses: actions/upload-artifact@v3 # 1. Configure Git
with: git config --global user.name "Gitea Actions"
name: github-pages # Gitea pages expects this specific name git config --global user.email "actions@gitea.com"
path: 'public/'
- name: Deploy to Pages Branch # 2. Prepare the directory for a fresh branch
uses: peaceiris/actions-gh-pages@v3 # We move the contents of 'public' into a temporary folder
with: mkdir ../temp_pages
personal_token: ${{ secrets.ACCESS_TOKEN }} # You'll need to create this in Gitea cp -r public/* ../temp_pages/
publish_branch: pages
publish_dir: ./public # 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