80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
name: Build and Push Container
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Setup uv
|
|
uses: astral-sh/setup-uv@v5
|
|
|
|
- name: Install PortAudio
|
|
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends portaudio19-dev
|
|
|
|
- name: Install dependencies
|
|
run: uv sync
|
|
|
|
- name: Ruff
|
|
run: uv run ruff check vibe_bot/
|
|
|
|
- name: Mypy
|
|
run: uv run mypy vibe_bot/
|
|
|
|
- name: Pyright
|
|
run: uv run pyright vibe_bot/
|
|
|
|
- name: Black
|
|
run: uv run black --check vibe_bot/
|
|
|
|
- name: Test
|
|
run: uv run pytest vibe_bot/tests/ -m "not live" -v
|
|
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
if: github.event_name != 'pull_request'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.reeseapps.com
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gitea.reeseapps.com/services/vibe-bot
|
|
tags: |
|
|
type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }}
|
|
type=ref,event=tag
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Containerfile
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|