commit
5812adb7cf
2 changed files with 15 additions and 21 deletions
19
.github/workflows/auto-update.yml
vendored
19
.github/workflows/auto-update.yml
vendored
|
|
@ -2,18 +2,18 @@ name: update-bot
|
|||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 20 * * *'
|
||||
- cron: '00 23 * * *'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: mogeko/qbittorrent
|
||||
IMAGE_NAME: ${{ github.repository_owner }}/qbittorrent
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
is_new: ${{ steps.check_ver.outputs.is_new }}
|
||||
version: ${{ steps.check_ver.outputs.version }}
|
||||
old_ver: ${{ steps.check_ver.outputs.old_ver }}
|
||||
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
||||
steps:
|
||||
- name: Check version
|
||||
id: check_ver
|
||||
|
|
@ -21,12 +21,8 @@ jobs:
|
|||
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
||||
OLD_VER=$(get_ver ${GHCO_URL})
|
||||
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
||||
if [ "$NEW_VER" != "$OLD_VER" ]; then
|
||||
echo "::set-output name=is_new::true"
|
||||
else
|
||||
echo "::set-output name=is_new::false"
|
||||
fi
|
||||
echo "::set-output name=version::${NEW_VER}"
|
||||
echo "::set-output name=old_ver::${OLD_VER}"
|
||||
echo "::set-output name=new_ver::${NEW_VER}"
|
||||
env:
|
||||
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
||||
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
||||
|
|
@ -34,7 +30,7 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
if: ${{ needs.check.outputs.is_new }}
|
||||
if: ${{ needs.check.outputs.old_ver != needs.check.outputs.new_ver }}
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
|
|
@ -60,6 +56,7 @@ jobs:
|
|||
type=edge
|
||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||
type=raw,${{ needs.check.outputs.version }}
|
||||
type=raw,latest
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: build
|
||||
|
|
|
|||
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
|
@ -10,14 +10,14 @@ on:
|
|||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: mogeko/qbittorrent
|
||||
IMAGE_NAME: ${{ github.repository_owner }}/qbittorrent
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
is_new: ${{ steps.check_ver.outputs.is_new }}
|
||||
version: ${{ steps.check_ver.outputs.version }}
|
||||
old_ver: ${{ steps.check_ver.outputs.old_ver }}
|
||||
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
||||
steps:
|
||||
- name: Check version
|
||||
id: check_ver
|
||||
|
|
@ -25,12 +25,8 @@ jobs:
|
|||
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
||||
OLD_VER=$(get_ver ${GHCO_URL})
|
||||
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
||||
if [ "$NEW_VER" != "$OLD_VER" ]; then
|
||||
echo "::set-output name=is_new::true"
|
||||
else
|
||||
echo "::set-output name=is_new::false"
|
||||
fi
|
||||
echo "::set-output name=version::${NEW_VER}"
|
||||
echo "::set-output name=old_ver::${OLD_VER}"
|
||||
echo "::set-output name=new_ver::${NEW_VER}"
|
||||
env:
|
||||
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
||||
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
||||
|
|
@ -38,7 +34,7 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
if: ${{ needs.check.outputs.is_new }}
|
||||
if: ${{ needs.check.outputs.old_ver != needs.check.outputs.new_ver }}
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
|
|
@ -57,6 +53,7 @@ jobs:
|
|||
type=edge
|
||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||
type=raw,${{ needs.check.outputs.version }}
|
||||
type=raw,latest
|
||||
|
||||
- name: Save status
|
||||
run: echo ${{ toJSON(steps.meta.outputs.json) }} > ${{ github.workspace }}/status.json
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue