Skip to content

Commit

Permalink
Merge pull request #96 from mondediefr/update
Browse files Browse the repository at this point in the history
update(): unrar and workflow
  • Loading branch information
Rathorian authored Nov 1, 2023
2 parents 8364569 + ea129f7 commit f0d6a5b
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 87 deletions.
153 changes: 77 additions & 76 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,95 @@
name: build

on:
push:
branches:
- master
schedule:
- cron: '0 8 * * 1'
- cron: '15 23 * * 5'
push:
branches: [ "master" ]

env:
IMAGE_NAME: ${{ github.repository }}

jobs:
latest:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Get date (YYYY.MM.dd)
id: fullDate
run: echo "fullDate=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
-
name: Get date (YYYY.MM)
id: yearMonthDate
run: echo "yearMonthDate=$(date +'%Y.%m')" >> $GITHUB_OUTPUT
-
name: Get date (YYYY)
id: yearDate
run: echo "yearDate=$(date +'%Y')" >> $GITHUB_OUTPUT
-
name: Dockerhub login
uses: docker/login-action@v2
- name: Checkout code
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: Get date (YYYY.MM.dd)
id: date
run: |
echo "FULL_DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build
run: |
docker buildx build \
--pull \
--push \
--platform linux/amd64,linux/arm64 \
--tag mondedie/rutorrent:latest \
--tag mondedie/rutorrent:${{ steps.fullDate.outputs.fullDate }} \
--tag mondedie/rutorrent:${{ steps.yearMonthDate.outputs.yearMonthDate }} \
--tag mondedie/rutorrent:${{ steps.yearDate.outputs.yearDate }} .

- name: Set Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
latest
${{ env.FULL_DATE }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}

filebot:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Get date (YYYY.MM.dd)
id: fullDate
run: echo "fullDate=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
-
name: Get date (YYYY.MM)
id: yearMonthDate
run: echo "yearMonthDate=$(date +'%Y.%m')" >> $GITHUB_OUTPUT
-
name: Get date (YYYY)
id: yearDate
run: echo "yearDate=$(date +'%Y')" >> $GITHUB_OUTPUT
-
name: Dockerhub login
uses: docker/login-action@v2
- name: Checkout code
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: Get date (YYYY.MM.dd)
id: date
run: |
echo "FULL_DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build
run: |
docker buildx build \
--pull \
--push \
--build-arg FILEBOT=true \
--platform linux/amd64,linux/arm64 \
--tag mondedie/rutorrent:filebot \
--tag mondedie/rutorrent:filebot-${{ steps.fullDate.outputs.fullDate }} \
--tag mondedie/rutorrent:filebot-${{ steps.yearMonthDate.outputs.yearMonthDate }} \
--tag mondedie/rutorrent:filebot-${{ steps.yearDate.outputs.yearDate }} .

- name: Set Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
build-args: |
FILEBOT=true
tags: |
filebot
filebot-${{ env.FULL_DATE }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
13 changes: 2 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.18 AS builder

ARG UNRAR_VER=6.2.11
ARG UNRAR_VER=6.2.12

RUN apk --update --no-cache add \
autoconf \
Expand Down Expand Up @@ -109,16 +109,7 @@ RUN if [ "${FILEBOT}" = true ]; then \
&& tar -xJf filebot.tar.xz \
&& rm -rf filebot.tar.xz \
&& sed -i 's/-Dapplication.deployment=tar/-Dapplication.deployment=docker/g' /filebot/filebot.sh \
# Fix filebot lib
&& case "${TARGETPLATFORM}" in \
"linux/amd64") \
rm -rf /filebot/lib/FreeBSD-amd64 /filebot/lib/Linux-aarch64 /filebot/lib/Linux-armv7l \
&& rm -rf /filebot/lib/Linux-x86_64/libzen.so /filebot/lib/Linux-x86_64/libmediainfo.so;; \
"linux/arm64") \
rm -rf /filebot/lib/FreeBSD-amd64 /filebot/lib/Linux-armv7l /filebot/lib/Linux-x86_64 \
&& rm -rf /filebot/lib/Linux-aarch64/libzen.so /filebot/lib/Linux-aarch64/libmediainfo.so;; \
esac; \
fi
&& find /filebot/lib -type f -not -name libjnidispatch.so -delete

COPY rootfs /
RUN chmod 775 /usr/local/bin/*
Expand Down

0 comments on commit f0d6a5b

Please sign in to comment.