-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scan threshold and auto-deploy to docker (#7)
* Allow 0 threshold * automatic versioning * Add the pragma only for sqlite
- Loading branch information
Showing
28 changed files
with
116 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: pictrs-safety new release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
build-n-publish: | ||
name: pictrs-safety new release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "✔️ Checkout" | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: "📣 Release on push" | ||
id: release | ||
uses: rymndhng/release-on-push-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
bump_version_scheme: norelease | ||
use_github_release_notes: true | ||
- name: "✏️ Generate release changelog" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
uses: heinrichreimer/github-changelog-generator-action@v2.3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: "💾 Commit new version" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
run: | | ||
version=${{ steps.release.outputs.version }} | ||
sed -i "s/^PICTRS_SAFETY_VERSION = .*/PICTRS_SAFETY_VERSION = ${version}/g" ./pictrs_safety_api/consts.py | ||
git config user.email github-actions@github.com | ||
git config user.name github-actions | ||
git commit -am 'version incremented' | ||
git push | ||
- name: Login to GitHub Container Registry | ||
if: ${{ steps.release.outputs.version != '' }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
# - name: Free disk space | ||
# if: ${{ steps.release.outputs.version != '' }} | ||
# uses: jlumbroso/free-disk-space@main | ||
# with: | ||
# tool-cache: false | ||
- name: "Build and Publish Container to Github Container Registry" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
run: | | ||
docker build -t ghcr.io/db0/pictrs-safety:${{ steps.release.outputs.version }} . | ||
docker push ghcr.io/db0/pictrs-safety:${{ steps.release.outputs.version }} | ||
docker push ghcr.io/db0/pictrs-safety:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,4 +161,6 @@ cython_debug/ | |
|
||
lemmy_safety.db | ||
lemmy_safety.db-journal | ||
api_test* | ||
api_test* | ||
images | ||
fedi_safety_api*.bz2 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pictrs_safety_api.apis.v1.base as base | ||
from pictrs_safety_api.apis.v1.base import api | ||
|
||
api.add_resource(base.Scan, "/scan/<string:pictrs_id>") | ||
api.add_resource(base.Pop, "/pop") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from pictrs_safety_api.flask import db, APP | ||
|
||
# Importing for DB creation | ||
from pictrs_safety_api.classes.request import ScanRequest | ||
|
||
with APP.app_context(): | ||
|
||
db.create_all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PICTRS_SAFETY_VERSION = "1.1.0" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters