-
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.
- Loading branch information
Showing
7 changed files
with
298 additions
and
89 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.git | ||
.vscode | ||
renovate.json | ||
.gitignore | ||
data/* | ||
systemd/* | ||
README.md |
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,76 @@ | ||
name: build-and-push | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "develop" | ||
tags: | ||
- '*' | ||
paths-ignore: | ||
- 'data/**' | ||
- 'systemd/**' | ||
- 'README.md' | ||
- 'renovate.json' | ||
pull_request: | ||
branches: | ||
- "develop" | ||
paths-ignore: | ||
- 'data/**' | ||
- 'systemd/**' | ||
- 'README.md' | ||
- 'renovate.json' | ||
|
||
jobs: | ||
build-and-push-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: buildx | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/thezak48/manga_dl | ||
flavor: | | ||
latest=auto,type=ref,event=branch,value=main | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor} | ||
type=semver,pattern={{major}} | ||
type=edge,branch=develop | ||
type=ref,event=pr | ||
type=sha | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.CR_ZAK }} | ||
|
||
- name: Docker build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event.pull_request.head.repo.full_name == 'thezak48/manga_dl' || github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
build-args: | | ||
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
VCS_REF=${{ github.sha }} | ||
VERSION=${{ steps.meta.outputs.tags }} |
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,34 @@ | ||
FROM python:3.9-alpine | ||
|
||
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories && \ | ||
echo "http://dl-4.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/repositories | ||
|
||
|
||
RUN apk --no-cache add chromium chromium-chromedriver | ||
RUN pip install --upgrade pip | ||
|
||
LABEL maintainer="thezak48" \ | ||
org.opencontainers.image.created=$BUILD_DATE \ | ||
org.opencontainers.image.url="https://github.com/thezak48/manga_dl" \ | ||
org.opencontainers.image.source="https://github.com/thezak48/manga_dl" \ | ||
org.opencontainers.image.version=$VERSION \ | ||
org.opencontainers.image.revision=$VCS_REF \ | ||
org.opencontainers.image.vendor="thezak48" \ | ||
org.opencontainers.image.title="manga_dl" \ | ||
org.opencontainers.image.description="manga_dl is an application to to download manga's, manhua's or manhwa's." | ||
|
||
ENV PUID=1000 | ||
ENV PGID=1000 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
COPY . / | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
RUN addgroup -g $PGID appgroup && \ | ||
adduser -D -u $PUID -G appgroup appuser && \ | ||
mkdir -p /config && \ | ||
chown -R appuser:appgroup /config | ||
USER appuser | ||
|
||
CMD [ "python", "/manga_dl.py" ] |
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
Oops, something went wrong.