Update .gitea/workflows/action.yaml
Build and Publish / build (push) Failing after 0s
Build and Publish / Build and Deploy Docs (push) Has been skipped

This commit is contained in:
2026-03-31 13:44:54 +02:00
parent e1b834e950
commit a9b0da7208
+17 -6
View File
@@ -25,13 +25,23 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
- name: Set Up Python Environment
uses: actions/setup-python@v4
with:
python-version: '3.12'
run: |
python3 -m venv venv # Create a virtual environment
source venv/bin/activate
pip install twine build
mkdir dist/
- name: Build the package
run: |
@@ -39,7 +49,7 @@ jobs:
python -m build
- name: Upload Package to Gitea PyPI
if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'build and publish')
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: "__token__" # Username for Twine when using token-based auth
TWINE_PASSWORD: ${{ secrets.PIP_REPOSITORY_API_TOKEN }} # Use the secret for authentication
@@ -67,7 +77,6 @@ jobs:
working-directory: docs
run: |
git fetch origin master:master || true
git checkout master || true
python3 -m venv venv
source venv/bin/activate
@@ -99,16 +108,18 @@ jobs:
# with the generated daq/docs/_build/html. This keeps only the documentation
# on the gitea-pages branch.
# Confirm build output exists (relative to repository root)
BUILD_DIR="daq/docs/_build/html"
BUILD_DIR="docs/_build/html"
echo "Checking build output at: $BUILD_DIR"
if [ ! -d "$BUILD_DIR" ] || [ -z "$(ls -A "$BUILD_DIR")" ]; then
echo "ERROR: $BUILD_DIR does not exist or is empty"
echo "Listing docs/:"
ls -la docs || true
echo "Listing daq/docs/_build:"
ls -la daq/docs/_build || true
echo "Listing docs/_build:"
ls -la docs/_build || true
exit 1
fi
# Work in a temporary clone to avoid touching the runner workspace
TMPDIR=$(mktemp -d)
REPO_URL="https://$DEPLOY_TOKEN@gitea.psi.ch/${{ github.repository }}"