Merge PR #5: CI: Add trigger for upstream releases

pull/9/head
Robert Adam 2022-05-07 21:04:13 +02:00 zatwierdzone przez GitHub
commit 54602c6fe9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 35 dodań i 1 usunięć

Wyświetl plik

@ -15,6 +15,9 @@ on:
publish:
required: true
type: boolean
update_latest:
required: true
type: boolean
jobs:
build:
@ -35,6 +38,14 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Configure target tags (with latest)
if: ${{ inputs.update_latest }}
run: echo "TAGS=mumblevoip/mumble-server:latest, mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV
- name: Configure target tags (without latest)
if: ${{ ! inputs.update_latest }}
run: echo "TAGS=mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
@ -44,6 +55,6 @@ jobs:
push: ${{ inputs.publish }}
build-args: |
MUMBLE_VERSION=${{ inputs.mumble_version }}
tags: mumblevoip/mumble-server:latest, mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}
tags: ${{ env.TAGS }}
env:
MUMBLE_VERSION: ${{ inputs.mumble_version }}

Wyświetl plik

@ -11,6 +11,7 @@ jobs:
mumble_version: "v1.4.230"
docker_version: '0'
publish: false
update_latest: false
platforms: "linux/amd64"
build_latest:
uses: ./.github/workflows/build_and_publish.yml
@ -18,4 +19,5 @@ jobs:
mumble_version: "latest"
docker_version: '0'
publish: false
update_latest: true
platforms: "linux/amd64"

Wyświetl plik

@ -15,6 +15,10 @@ on:
description: "Whether the built image(s) shall be published to Dockerhub"
required: true
default: "false"
update_latest:
description: "Whether to update the 'latest' tag on Dockerhub"
required: true
default: "false"
jobs:
manual_dispatch:
@ -23,5 +27,6 @@ jobs:
mumble_version: ${{ github.event.inputs.mumble_version }}
docker_version: ${{ github.event.inputs.docker_version }}
publish: ${{ github.event.inputs.publish == 'true' }}
update_latest: ${{ github.event.inputs.update_latest == 'true' }}
platforms: "linux/amd64"
secrets: inherit

Wyświetl plik

@ -0,0 +1,16 @@
name: Upstream Release
on:
repository_dispatch:
types: [ new_release ]
jobs:
publish_new_release:
uses: ./.github/workflows/build_and_publish.yml
with:
mumble_version: ${{ github.event.client_payload.tag }}
docker_version: '0'
publish: true
update_latest: ${{ github.event.client_payload.is_latest }}
platforms: "linux/amd64"
secrets: inherit