build(ci): always check metadata
This commit is contained in:
parent
8c7ae5b659
commit
5f8bb5c1e7
1 changed files with 5 additions and 13 deletions
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
|
|
@ -8,33 +8,23 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
IMAGE_NAME: ${{ github.repository_owner }}/qbittorrent
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
old_ver: ${{ steps.check_ver.outputs.old_ver }}
|
|
||||||
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check version
|
- name: Check version
|
||||||
id: check_ver
|
id: check_ver
|
||||||
run: |
|
run: |
|
||||||
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
NEW_VER=$(curl -s "${ALPINE_PKG_URL}" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
||||||
OLD_VER=$(get_ver ${GHCO_URL})
|
|
||||||
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
|
||||||
echo "::set-output name=old_ver::${OLD_VER}"
|
|
||||||
echo "::set-output name=new_ver::${NEW_VER}"
|
echo "::set-output name=new_ver::${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
|
|
||||||
|
|
||||||
build:
|
meta:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
if: ${{ needs.check.outputs.old_ver != needs.check.outputs.new_ver }}
|
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -48,7 +38,9 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@548e2346a9987b56d8a4104fe776321ff8e23440
|
uses: docker/metadata-action@548e2346a9987b56d8a4104fe776321ff8e23440
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: |
|
||||||
|
{{ github.repository_owner }}/qbittorrent
|
||||||
|
ghcr.io/{{ github.repository_owner }}/qbittorrent
|
||||||
tags: |
|
tags: |
|
||||||
type=edge
|
type=edge
|
||||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue