steps: - name: test-UTs image: python:3.13-slim commands: - pip install -r requirements.txt - cd ./src - python manage.py test apps - name: test-FTs image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest environment: HEADLESS: 1 commands: - cd ./src - python manage.py collectstatic --noinput - python manage.py test functional_tests - name: screendumps image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest when: - status: failure commands: - cat ./src/functional_tests/screendumps/*.html || echo "No screendumps found" - name: build-and-push image: docker:cli environment: REGISTRY_PASSWORD: from_secret: gitea_registry_password commands: - echo "$REGISTRY_PASSWORD" | docker login gitea.earthmanrpg.me -u discoman --password-stdin - docker build -t gitea.earthmanrpg.me/discoman/gamearray:latest . - docker push gitea.earthmanrpg.me/discoman/gamearray:latest when: - branch: main - event: push - name: deploy image: alpine environment: SSH_KEY: from_secret: deploy_ssh_key commands: - apk add --no-cache openssh-client - mkdir -p ~/.ssh - printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - ssh -o StrictHostKeyChecking=no discoman@staging.earthmanrpg.me /opt/gamearray/deploy.sh when: - branch: main - event: push