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