-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (80 loc) · 2.19 KB
/
worker.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Smriti Worker CI
on:
push:
branches:
- master
paths:
- worker/**
- .github/workflows/worker.yaml
pull_request:
branches:
- master
paths:
- worker/**
- .github/workflows/worker.yaml
release:
types: [published]
jobs:
ci:
name: Integration Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./worker
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12.x'
- name: Python Version
run: python -c "import sys; print(sys.version)"
- name: Install Dependencies
run: make install
- name: Run Lint
run: |
pip install pylint==3.2.3
make lint
- name: Run Test & Cover
run: |
sudo apt-get install -y libimage-exiftool-perl exiftool libraw-dev
make test-install
make cover
- name: Publish Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: worker
files: worker/coverage.xml
publish:
if: ${{ (github.event_name == 'release' && github.event.action == 'published') || github.ref == 'refs/heads/master' }}
needs: ci
name: Publish Docker Image
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./worker
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build and Push
uses: docker/build-push-action@v5
with:
context: worker
file: ./worker/Dockerfile
push: true
platforms: linux/amd64,linux/arm64/v8
build-args: |
GITSHA=${{ github.sha }}
VERSION=${ github.ref_name }}
tags: smritihq/worker:${{ github.ref_name }}