Compare commits
2 commits
9be6a07052
...
9b83373450
Author | SHA1 | Date | |
---|---|---|---|
9b83373450 | |||
7160e1b2a5 |
3 changed files with 107 additions and 29 deletions
|
@ -9,22 +9,90 @@ on:
|
||||||
branches: [main, master]
|
branches: [main, master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-container:
|
|
||||||
uses: actions/workflows/.gitea/workflows/build_container.yml@master
|
|
||||||
with:
|
|
||||||
registry: docker.io
|
|
||||||
image-name: olofvndrhr/manga-dlp
|
|
||||||
context: .
|
|
||||||
dockerfile: docker/Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
secrets:
|
|
||||||
cr-username: ${{ secrets.CR_USERNAME }}
|
|
||||||
cr-password: ${{ secrets.CR_PASSWORD }}
|
|
||||||
|
|
||||||
build-pypackage:
|
build-pypackage:
|
||||||
uses: actions/workflows/.gitea/workflows/release_pypackage.yml@master
|
runs-on: python311
|
||||||
|
env:
|
||||||
|
HATCH_INDEX_REPO: main
|
||||||
|
HATCH_INDEX_USER: __token__
|
||||||
|
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: install hatch
|
||||||
|
run: pip install -U hatch hatchling
|
||||||
|
|
||||||
|
- name: build package
|
||||||
|
run: hatch build --clean
|
||||||
|
|
||||||
|
- name: publish package
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
run: hatch publish --yes --no-prompt
|
||||||
|
|
||||||
|
build-container:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
REGISTRY: docker.io
|
||||||
|
AUTHOR: olofvndrhr
|
||||||
|
IMAGE: manga-dlp
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: setup docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: get container metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: metadata
|
||||||
with:
|
with:
|
||||||
repository: main
|
images: ${{ env.REGISTRY }}/${{ env.AUTHOR }}/${{ env.IMAGE }}
|
||||||
secrets:
|
flavor: |
|
||||||
username: __token__
|
latest=auto
|
||||||
token: ${{ secrets.PYPI_TOKEN }}
|
prefix=
|
||||||
|
suffix=
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: login to docker.io container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.CR_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PASSWORD }}
|
||||||
|
|
||||||
|
- name: login to private container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.44net.ch
|
||||||
|
username: ${{ secrets.CR_PRIV_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PRIV_PASSWORD }}
|
||||||
|
|
||||||
|
- name: build and push docker image @amd64+arm64
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: ${{ gitea.event_name != 'pull_request' }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
context: .
|
||||||
|
file: docker/Dockerfile
|
||||||
|
provenance: false
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
|
||||||
|
- name: update dockerhub repo description
|
||||||
|
uses: peter-evans/dockerhub-description@v3
|
||||||
|
with:
|
||||||
|
repository: ${{ env.AUTHOR }}/${{ env.IMAGE }}
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
enable-url-completion: true
|
||||||
|
username: ${{ secrets.CR_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PASSWORD }}
|
||||||
|
|
|
@ -8,16 +8,6 @@ on:
|
||||||
branches: [main, master]
|
branches: [main, master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
scan-code-py311:
|
|
||||||
uses: actions/workflows/.gitea/workflows/sonarqube_python.yml@master
|
|
||||||
needs: [check-code]
|
|
||||||
if: gitea.event_name != 'pull_request'
|
|
||||||
with:
|
|
||||||
run-coverage: true
|
|
||||||
secrets:
|
|
||||||
sonar-host: ${{ secrets.SONARQUBE_HOST }}
|
|
||||||
sonar-token: ${{ secrets.SONARQUBE_TOKEN }}
|
|
||||||
|
|
||||||
check-docs:
|
check-docs:
|
||||||
runs-on: python311
|
runs-on: python311
|
||||||
steps:
|
steps:
|
||||||
|
@ -30,6 +20,27 @@ jobs:
|
||||||
cd docs || exit 1
|
cd docs || exit 1
|
||||||
mkdocs build --strict
|
mkdocs build --strict
|
||||||
|
|
||||||
|
scan-code-py311:
|
||||||
|
runs-on: python311
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: install hatch
|
||||||
|
run: pip install -U hatch
|
||||||
|
|
||||||
|
- name: get coverage (hatch)
|
||||||
|
run: hatch run default:cov
|
||||||
|
|
||||||
|
- name: run sonar-scanner
|
||||||
|
uses: sonarsource/sonarqube-scan-action@v2.0.1
|
||||||
|
env:
|
||||||
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
|
||||||
check-code-py38:
|
check-code-py38:
|
||||||
runs-on: python38
|
runs-on: python38
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -8,4 +8,3 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
# "s6-setuidgid abc" is used to set the permissions
|
# "s6-setuidgid abc" is used to set the permissions
|
||||||
|
|
||||||
0 12 * * * root s6-setuidgid abc /app/schedules/daily.sh > /proc/1/fd/1 2>&1
|
0 12 * * * root s6-setuidgid abc /app/schedules/daily.sh > /proc/1/fd/1 2>&1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue