57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
on:
|
|
push:
|
|
workflow_dispatch:
|
|
inputs:
|
|
verbose:
|
|
description: "Verbose"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: container
|
|
container:
|
|
image: tiptop:5000/python-ci
|
|
volumes:
|
|
- "uv_cache:/root/.cache/uv"
|
|
- "ca-cert:/etc/containers/certs.d"
|
|
services:
|
|
treetrail-database:
|
|
image: treetrail-database
|
|
steps:
|
|
- name: Echo env
|
|
if: ${{ inputs.verbose }}
|
|
run: |
|
|
echo '${{ toJSON(env) }}'
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Create venv
|
|
run: uv venv
|
|
- name: Install dependencies
|
|
run: uv sync
|
|
- name: Run basic test (bootstrap)
|
|
run: pytest -s tests/basic.py
|
|
|
|
- name: Log in to container registry
|
|
uses: actions/podman-login@v1
|
|
with:
|
|
registry: ${{ vars.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
auth_file_path: /tmp/auth.json
|
|
|
|
- name: Build container
|
|
uses: actions/buildah-build@v1
|
|
with:
|
|
image: treetrail-backend
|
|
#tags: foo # v1 ${{ github.sha }}
|
|
containerfiles: |
|
|
./Containerfile.for_runner
|
|
|
|
- uses: actions/push-to-registry@v2
|
|
with:
|
|
registry: "docker://${{ vars.REGISTRY }}"
|
|
image: treetrail-backend
|
|
tags: latest
|