2 Commits
1.0 ... v1.0.1

Author SHA1 Message Date
07725c99b4 Add release process
All checks were successful
Docker Build and Publish / build (push) Successful in 6s
Docker Build and Publish / build (release) Successful in 7s
2024-11-05 23:49:09 -05:00
05a184fcf7 Sizing Fix
All checks were successful
Docker Build and Publish / build (push) Successful in 7s
2024-11-05 22:11:45 -05:00
3 changed files with 17 additions and 7 deletions

View File

@ -3,9 +3,11 @@ name: Docker Build and Publish
on: on:
push: push:
branches: [ main ] branches: [ main ]
tags: [ 'v*' ] tags: [ 'v*.*.*' ]
pull_request: pull_request:
branches: [ main ] branches: [ main ]
release:
types: [published]
jobs: jobs:
build: build:
@ -20,11 +22,11 @@ jobs:
with: with:
images: git.dws.rip/${{ github.repository }} images: git.dws.rip/${{ github.repository }}
tags: | tags: |
type=ref,event=branch type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=sha,format=long
type=ref,event=pr type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Login to Gitea Container Registry - name: Login to Gitea Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2

View File

@ -114,4 +114,12 @@ spectra/
- `FLASK_ENV`: Set to 'production' in production - `FLASK_ENV`: Set to 'production' in production
- `WORKERS`: Number of Gunicorn workers (default: 4) - `WORKERS`: Number of Gunicorn workers (default: 4)
- `PORT`: Override default port (default: 5000) - `PORT`: Override default port (default: 5000)
## Release Process
To create a release:
- Create and push a tag: `git tag v1.0.0 && git push origin v1.0.0`
- Create a release in Gitea UI using that tag
- The workflow will build and push the Docker image with appropriate version tags
- The Docker image will be available at: `git.dws.rip/your-repo/image:v1.0.0`

2
app.py
View File

@ -289,7 +289,7 @@ def get_images():
images = [] images = []
for photo in photos: for photo in photos:
factor = random.randint(2, 3) factor = random.randint(2, 3)
if photo.height < 4000 or photo.width < 4000: if photo.height < 4000 and photo.width < 4000:
factor = 1 factor = 1
if photo.orientation == 6 or photo.orientation == 8: if photo.orientation == 6 or photo.orientation == 8:
width, height = photo.height, photo.width width, height = photo.height, photo.width