-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use python-minimal container images and cleanup CI (#174)
* use s2i-python and python-minimal container images * ci cleanup/fix * use 8080 as default port * wheel based install
- Loading branch information
Showing
10 changed files
with
148 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
name: Test and Release | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
|
||
jobs: | ||
test: | ||
|
@@ -21,47 +17,3 @@ jobs: | |
- name: Test | ||
run: | | ||
pytest --cov=app --cov-report=term --cov-fail-under=100 | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Docker meta | ||
id: docker_meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ghcr.io/radiorabe/catpage | ||
flavor: | | ||
latest=auto | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: go-semantic-release/[email protected] | ||
with: | ||
github-token: ${{ secrets.GH_PAT_TOKEN }} |
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,74 @@ | ||
name: Publish Container Images | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
pull_request: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare additional Metadata | ||
id: addtional_meta | ||
run: | | ||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
- name: Prepare Image Metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/radiorabe/catpage | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
labels: | | ||
name=cat-page | ||
summary=${{ github.event.repository.description }} | ||
url=${{ github.event.repository.html_url }} | ||
vcs-ref=${{ github.sha }} | ||
revision=${{ github.sha }} | ||
release=${{ github.sha }} | ||
build-date=${{ steps.addtional_meta.outputs.created }} | ||
io.k8s.display-name=Cat Page | ||
io.k8s.description=${{ github.event.repository.description }} | ||
io.openshift.tags=minimal rhel8 rabe s2i python python39 catpage | ||
version=1 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: | | ||
${{ steps.meta.outputs.labels }} | ||
version=${{ steps.meta.outputs.version }} |
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,21 @@ | ||
name: Run semantic-release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
semantic-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run go-semantic-release | ||
id: semrel | ||
uses: go-semantic-release/action@v1 | ||
with: | ||
github-token: ${{ secrets.RABE_ITREAKTION_GITHUB_TOKEN }} |
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,2 @@ | ||
recursive-include app/templates * | ||
recursive-include app/static * |
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
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
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ services: | |
env_file: | ||
- .env | ||
ports: | ||
- "5000:5000" | ||
- "8080:8080" |
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,27 @@ | ||
"""Set up cat-page.""" | ||
|
||
from setuptools import find_packages, setup | ||
|
||
with open("requirements.txt") as file: | ||
requirements = file.read().splitlines() | ||
|
||
|
||
setup( | ||
name="cat-page", | ||
description="RaBe Cat Landing Page", | ||
url="http://github.com/radiorabe/cat-page", | ||
author="RaBe IT-Reaktion", | ||
author_email="[email protected]", | ||
license="AGPL-3", | ||
version_config=True, | ||
setup_requires=["setuptools-git-versioning"], | ||
install_requires=requirements, | ||
packages=find_packages(exclude=("tests",)), | ||
include_package_data=True, | ||
entry_points={"console_scripts": ["catpage=app.server:main"]}, | ||
zip_safe=True, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: GNU Affero General Public License v3", | ||
], | ||
) |