-
Notifications
You must be signed in to change notification settings - Fork 10
25 lines (25 loc) · 1.15 KB
/
check-bux-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name: "[Reuse] check-bux-version"
on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
buxversion:
description: "Newest version of bux-server"
value: ${{ jobs.check-docker-tag.outputs.output1 }}
dockerNotFound:
description: "Is docker image with version not found"
value: ${{ jobs.check-docker-tag.outputs.output2 }}
jobs:
check-docker-tag:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.bux-version.outputs.buxServerVersion }}
output2: ${{ steps.docker-image.outputs.dockerNotFound }}
steps:
- name: load newest version number of bux-server
id: bux-version
run: |
git ls-remote --exit-code -t --refs --sort='version:refname' https://github.com/BuxOrg/bux-server.git '*.*.*' | tail --lines=1 | awk -F/ '{ print $3 }' | xargs -I {} echo "buxServerVersion={}" >> $GITHUB_OUTPUT
- name: check if docker for version exists
id: docker-image
run: (docker pull 4chainstudio/bux-server:${{ steps.bux-version.outputs.buxServerVersion }} > /dev/null 2>&1 && echo "dockerNotFound=false" || echo "dockerNotFound=true") >> $GITHUB_OUTPUT