feat: added build/test pipeline
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: sh
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: python:3.13-bookworm
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone https://git.spookydev.com/${{ gitea.repository }}.git .
|
||||
git checkout ${{ gitea.sha }}
|
||||
|
||||
- name: Install uv
|
||||
run: pip install uv --quiet
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv pip install -r pyproject.toml --group=dev
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone https://git.spookydev.com/${{ gitea.repository }}.git .
|
||||
git checkout ${{ gitea.sha }}
|
||||
|
||||
- name: Build and push
|
||||
run: |
|
||||
docker build -t registry.spookydev.com/${{ gitea.repository }}:${{ gitea.sha }} .
|
||||
docker tag registry.spookydev.com/${{ gitea.repository }}:${{ gitea.sha }} \
|
||||
registry.spookydev.com/${{ gitea.repository }}:latest
|
||||
docker login registry.spookydev.com \
|
||||
-u ${{ secrets.REGISTRY_USER }} \
|
||||
-p ${{ secrets.REGISTRY_PASSWORD }}
|
||||
docker push registry.spookydev.com/${{ gitea.repository }}:${{ gitea.sha }}
|
||||
docker push registry.spookydev.com/${{ gitea.repository }}:latest
|
||||
Reference in New Issue
Block a user