Update docker-build-multiarch.yml
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 1 Nov 2020 08:05:50 +0000 (09:05 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 1 Nov 2020 08:05:50 +0000 (09:05 +0100)
.github/workflows/docker-build-multiarch.yml

index c57a77402cc4a5672fb7b14b9ebfacc17dadf5e1..8d90c592581c8362851d3d2b08f4e12930ab0c78 100644 (file)
@@ -9,6 +9,9 @@ on:
         description: 'Log level'     
         required: true
         default: 'warning'
+      tag:
+        description: 'Tag to set on docker image (e.g. 0.0.1'
+        required: true
 
 jobs:
   buildx:
@@ -16,20 +19,20 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v2
-      - uses: oprypin/find-latest-tag@v1
-        with:
-          repository: music-assistant/server  # The repository to scan.
-          releases-only: true  # We know that all relevant tags have a GitHub release for them.
-        id: mass  # The step ID to refer to later.
+
       - name: Prepare
         id: prep
         run: |
           DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/music-assistant
           VERSION=latest
-          SHORTREF=${{ steps.mass.outputs.tag }}
+          SHORTREF=${GITHUB_SHA::8}
 
+          # If a manual tag was supplied, use that
+          if [[ -n $github.event.inputs.tag ]]; then
+            VERSION=${github.event.inputs.tag}
+            
           # If this is git tag, use the tag name as a docker tag
-          if [[ $GITHUB_REF == refs/tags/* ]]; then
+          elif [[ $GITHUB_REF == refs/tags/* ]]; then
             VERSION=${GITHUB_REF#refs/tags/v}
           fi
           TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"