-
Notifications
You must be signed in to change notification settings - Fork 32
58 lines (52 loc) · 1.51 KB
/
dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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.10.13'
- 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
- name: "Delete untagged versions"
uses: actions/delete-package-versions@v4
with:
package-name: 'decluttarr'
package-type: 'container'
delete-only-untagged-versions: 'true'