diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fd19cc8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.github +.gitea +.remember +.env +.DS_Store diff --git a/.gitea/workflows/build-push.yml b/.gitea/workflows/build-push.yml new file mode 100644 index 0000000..a2676c0 --- /dev/null +++ b/.gitea/workflows/build-push.yml @@ -0,0 +1,54 @@ +name: Build and Push Docker Image + +on: + push: + branches: [main] + schedule: + - cron: '0 0 3 * *' # Monthly on the third day, at midnight UTC. + workflow_dispatch: + +jobs: + build: + runs-on: kube + if: github.ref == 'refs/heads/main' + env: + DOCKER_BUILD_RECORD_UPLOAD: 'false' + DOCKER_BUILD_SUMMARY: 'false' + steps: + - name: Checkout code + uses: https://github.com/actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Docker CLI + run: | + apt-get update + apt-get install -y --no-install-recommends docker.io + rm -rf /var/lib/apt/lists/* + + - name: Log in to Docker Hub + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Set up temporary builder + uses: https://github.com/docker/setup-buildx-action@v3 + with: + driver: docker-container + cache-binary: false + keep-state: false + cleanup: true + + - name: Build and push to Docker Hub + uses: https://github.com/docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + pull: true + push: true + load: false + tags: docker.io/k2patel/rtorrent:latest + labels: | + org.opencontainers.image.source=https://git.k2patel.in/k2patel/docker-rtorrent + org.opencontainers.image.revision=${{ github.sha }} diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml deleted file mode 100644 index b353815..0000000 --- a/.github/workflows/build-push.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build and Push Docker Image - - -# This workflow is manually triggered from the "Actions" tab in GitHub. -# It requires a single input: the version tag of the flood repository to use. -on: - schedule: - - cron: '0 0 3 * *' # This runs at midnight on the first day of every month - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Set Image name - run: | - echo "IMAGE_NAME=k2patel/rtorrent:latest" >> $GITHUB_ENV - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Build the Docker image - id: build - run: | - docker build . -t ${{ env.IMAGE_NAME }} - - - name: Push the Docker image - run: docker push ${{ env.IMAGE_NAME }} diff --git a/README.md b/README.md index d669cf9..f512bf8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # docker-rtorrent This is plain simple rtorrent with proxy and custom rtorrent.rc +Source: https://git.k2patel.in/k2patel/docker-rtorrent + +Gitea Actions builds and publishes `docker.io/k2patel/rtorrent:latest` +on pushes to `main`, manually, and monthly on the third day at 00:00 UTC. +The repository requires Actions secrets `DOCKER_USERNAME` and `DOCKER_TOKEN` +(a Docker Hub token with write access to `k2patel/rtorrent`). + +Builds run on the remote Kubernetes runner for `linux/amd64`, matching the +previous GitHub build. Buildx pushes directly to Docker Hub without loading +the image into the runner's Docker image store. Its temporary builder and +build cache are removed after each job; no image archives or build records +are uploaded to Gitea, and no local container builds are required. + # Latest 0.16 version caveat - since version 0.16 explicitly set `network.bind_address.set = 0.0.0.0`, when ipv6 is disabled on kernel.