treetrail-backend/.forgejo/workflows/build-with-app-image.yaml
phil ac664886e3
Some checks failed
/ build (push) Failing after 29s
CI: build: fix registry login 4
2024-10-29 03:27:52 +01:00

76 lines
2 KiB
YAML

on:
workflow_dispatch:
inputs:
verbose:
description: "Verbose"
required: false
default: false
type: boolean
build:
description: "Build container image"
required: false
default: false
type: boolean
push:
description: "Push container image to registry"
required: false
default: false
type: boolean
jobs:
build:
runs-on: container
container:
image: tiptop:5000/treetrail-backend-ci
volumes:
- "uv_cache:/root/.cache/uv"
services:
treetrail-database:
image: treetrail-database
env:
PYTHONPATH: /app/lib/python3.12/site-packages
UV_PROJECT_ENVIRONMENT: /app
steps:
- uses: actions/checkout@v4
- name: Install dependencies (to uv's project environment)
run: uv sync --locked --no-dev --no-editable
- name: Install dependencies for testing
run: uv pip install httpx
- name: Echo env
if: ${{ inputs.verbose }}
run: |
echo '${{ toJSON(env) }}'
- name: Run basic test (bootstrap)
run: pytest -s tests/basic.py
- name: Install podman and buildah
if: ${{ inputs.build }}
run: |
apt-get install -y --no-install-recommends podman buildah
- name: Build container
if: ${{ inputs.build }}
uses: actions/buildah-build@v1
with:
image: treetrail-backend
#tags: foo # v1 ${{ github.sha }}
containerfiles: |
./Containerfile.for_runner
- name: Log in to container registry
uses: actions/podman-login@v1
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- uses: actions/push-to-registry@v2
if: ${{ inputs.push }}
with:
registry: "docker://${{ vars.REGISTRY }}"
image: treetrail-backend
tags: latest