Skip to content

Commit

Permalink
add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhigh committed Jun 16, 2024
1 parent 8c22778 commit e7bc5f4
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 2 deletions.
92 changes: 92 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Git
.git
.gitignore
.gitattributes


# CI
.codeclimate.yml
.travis.yml
.taskcluster.yml

# Docker
docker-compose.yml
Dockerfile
.docker
.dockerignore

# Byte-compiled / optimized / DLL files
**/__pycache__/
**/*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Virtual environment
.env
.venv/
venv/

# PyCharm
.idea

# Python mode for VIM
.ropeproject
**/.ropeproject

# Vim swap files
**/*.swp

# VS Code
.vscode/

.tags
.tags_sorted_by_file
19 changes: 19 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Python pycache:
__pycache__/
# Ignored by the build system
/setup.cfg
49 changes: 49 additions & 0 deletions .github/workflows/docker_build_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Build and Push

on:
workflow_dispatch:
inputs:
branch:
description: "The branch, tag or SHA to release from"
required: true
default: "master"

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Checkout code
uses: actions/checkout@v2

- name: Get version from main.py
id: get_version
run: |
version=$(grep -oP "__Version__ = '\K[^']+" main.py)
if [ -z "$version" ]; then
echo "Error: Unable to retrieve version from main.py"
exit 1
else
echo "::set-output name=version::$version"
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push Docker image
env:
IMAGE_NAME: kindleear/kindleear
TAG_LATEST: latest
TAG_VERSION: ${{ steps.get_version.outputs.version }}
run: |
docker buildx build --push --platform=linux/amd64,linux/arm64 -t $IMAGE_NAME:$TAG_LATEST -t $IMAGE_NAME:$TAG_VERSION -f docker/Dockerfile .
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.pyc
.DS_Store
.*
.git/
*.db
*.mobi
*.epub
Expand All @@ -12,4 +12,7 @@ tests/rss/*
tests/debug_mail/*
tests/cov_html/*
.idea/
datastore/
datastore/
.coverage
.tags
.tags_sorted_by_file
3 changes: 3 additions & 0 deletions docs/.debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
remote_theme: false

theme: jekyll-rtd-theme

0 comments on commit e7bc5f4

Please sign in to comment.