Files
decluttarr/.github/workflows/dev.yml
Benjamin Harder 6b35924975 test
2023-10-06 15:30:18 +02:00

52 lines
1.3 KiB
YAML

name: Unit Tests & Dev Deployment
on:
push:
branches: [ "dev" ]
jobs:
unit-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '.'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install pip and pytest
run: |
python -m pip install --upgrade pip
pip install -r docker/requirements.txt
- name: Test with pytest
run: |
python3 -m pytest --import-mode=append tests/
build-dev:
# if: github.ref == 'refs/heads/dev'
needs: unit-tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: '.'
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: "Build, Tag, and push the Docker image"
env:
IMAGE_NAME: ghcr.io/manimatter/decluttarr
IMAGE_TAG: dev
run: |
docker build -f docker/Dockerfile -t $IMAGE_NAME:$IMAGE_TAG .
docker push $IMAGE_NAME:$IMAGE_TAG