diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 6d7b4d9..88d6879 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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 \ No newline at end of file + # 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 \ No newline at end of file