Skip to content

Commit

Permalink
Add docker build in ci
Browse files Browse the repository at this point in the history
Co-authored-by: vonProteus <699900+vonProteus@users.noreply.github.com>
  • Loading branch information
mansuf and vonProteus committed Jun 5, 2024
1 parent 482285a commit 2ea9158
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 4 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,66 @@ on:
tags:
- v*

env:
TEST_TAG: mansuf/mangadex-downloader:test
LATEST_TAG: mansuf/mangadex-downloader:latest

jobs:
build:
name: Build app
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET_TOKEN }}

- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}

- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: Update Docker Hub description
# if: startsWith(github.ref, 'refs/tags/') && github.repository == 'mansuf/mangadex-downloader'
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET_TOKEN }}
repository: mansuf/mangadex-downloader
short-description: ${{ github.event.repository.description }}

- name: Build and push
# if: startsWith(github.ref, 'refs/tags/') && github.repository == 'mansuf/mangadex-downloader'
uses: docker/build-push-action@v5
with:
context: .
platforms: |
linux/amd64
linux/arm64
linux/arm/v7
linux/arm/v6
push: true
tags: |
${{ env.LATEST_TAG }}
mansuf/mangadex-downloader:${{ github.ref_name }}
windows-build:
name: Build app & docs (Windows)
runs-on: windows-latest
strategy:
matrix:
Expand Down
30 changes: 28 additions & 2 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,36 @@ on:
- 'requirements-optional.txt'
- 'docs/*'

env:
TEST_TAG: mansuf/mangadex-downloader:test
LATEST_TAG: mansuf/mangadex-downloader:latest

jobs:
build:
name: Build app & docs
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}

- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
windows-build:
name: Build app & docs (Windows)
runs-on: windows-latest
strategy:
matrix:
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.11

RUN pip install .[optional]

WORKDIR /downloads

ENTRYPOINT [ "mangadex-downloader" ]

CMD [ "--help" ]

0 comments on commit 2ea9158

Please sign in to comment.