diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 1ea2d40..213f615 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -25,27 +25,16 @@ jobs: run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.somantis.net -u "${{ secrets.REGISTRY_USER }}" --password-stdin # Tags: main-Push -> latest + SHA; Tag-Push (v*) -> vX.Y.Z + SHA. - # So zieht man entweder die aktuelle Version (:latest) oder eine - # feste Version (z.B. :v1.0.0). - - name: Image-Tags bestimmen - id: img + # Gebaut und gepusht wird in einem Schritt (keine Step-Outputs noetig). + - name: Image bauen und pushen run: | IMG="git.somantis.net/j4stmarkus/trainingsplan" - TAGS="$IMG:latest" + TAGS=("$IMG:latest") if [ "${{ github.ref_type }}" = "tag" ]; then - TAGS="$TAGS $IMG:${{ github.ref_name }}" + TAGS+=("$IMG:${{ github.ref_name }}") fi - TAGS="$TAGS $IMG:${{ github.sha }}" - echo "tags=$TAGS" >> "$GITHUB_OUTPUT" - echo "tags=$TAGS" - - - name: Image bauen - run: | + TAGS+=("$IMG:${{ github.sha }}") ARGS=() - for t in ${{ steps.img.outputs.tags }}; do - ARGS+=("-t" "$t") - done + for t in "${TAGS[@]}"; do ARGS+=("-t" "$t"); done docker build --no-cache "${ARGS[@]}" . - - - name: Image pushen - run: docker push ${{ steps.img.outputs.tags }} \ No newline at end of file + for t in "${TAGS[@]}"; do docker push "$t"; done \ No newline at end of file