57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: Build Container
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
|
steps:
|
|
- name: Check version
|
|
id: check_ver
|
|
run: |
|
|
NEW_VER=$(curl -s "${ALPINE_PKG_URL}" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
|
echo "::set-output name=new_ver::${NEW_VER}"
|
|
env:
|
|
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
|
|
|
meta:
|
|
runs-on: ubuntu-latest
|
|
needs: check
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@548e2346a9987b56d8a4104fe776321ff8e23440
|
|
with:
|
|
images: |
|
|
{{ github.repository_owner }}/qbittorrent
|
|
ghcr.io/{{ github.repository_owner }}/qbittorrent
|
|
tags: |
|
|
type=edge
|
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
|
type=raw,${{ needs.check.outputs.new_ver }}
|
|
type=raw,latest
|
|
|
|
- name: Save status
|
|
run: echo ${{ toJSON(steps.meta.outputs.json) }} > ${{ github.workspace }}/status.json
|
|
|
|
- name: Update status
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: status
|
|
path: ${{ github.workspace }}/status.json
|