Skip to content

Commit 5032755

Browse files
DaanSelenDaan Selen
andauthored
fix: workflow again where every tag is given. (Ylianst#7293)
* Workflow split (Ylianst#14) * Made the workflow build multiple images for simplicity * New method * Trying workflow * Finalize * Reset package files to upstream/master * Edit workflow according to @si458 * Whoops accidentally removed these. Back again. * Testing out embedded tokens * Workflow split (Ylianst#12) * Made the workflow build multiple images for simplicity * New method * Trying workflow * Finalize * Reset package files to upstream/master * Edit workflow according to @si458 * Whoops accidentally removed these. Back again. * Testing out embedded tokens --------- Co-authored-by: Daan Selen <dselen@systemec.nl> * Why the flip do we even use that??? * Testing out suggestions of permissions * Testing fallback. * Remove fallback * Minor removal of comment --------- Co-authored-by: Daan Selen <dselen@systemec.nl> * fix: workflow like we want --------- Co-authored-by: Daan Selen <dselen@systemec.nl>
1 parent d4c4a90 commit 5032755

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/docker.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
env:
1313
REGISTRY: ghcr.io
1414
IMAGE_NAME: ${{ github.repository || 'MeshCentral' }}
15-
REGISTRY_USERNAME: ${{ github.repository_owner || 'DaanSelen' }}
15+
REGISTRY_USERNAME: ${{ github.repository_owner || 'meshcentral-extensions' }}
1616

1717
jobs:
1818
build-images:
@@ -22,7 +22,7 @@ jobs:
2222
contents: read
2323
runs-on: ubuntu-latest
2424
strategy:
25-
#max-parallel: 3
25+
#max-parallel: 1
2626
matrix:
2727
variant:
2828
- name: complete
@@ -98,14 +98,31 @@ jobs:
9898
working-directory: ./translate
9999
run: node translate.js translateall
100100

101+
- name: process tags with suffix
102+
id: clean-tag
103+
run: |
104+
SUFFIX="${{ matrix.variant.tag_suffix }}"
105+
# Read each line into an array
106+
mapfile -t TAGS <<< "${{ steps.meta.outputs.tags }}"
107+
108+
RESULT=""
109+
for tag in "${TAGS[@]}"; do
110+
if [ -n "$RESULT" ]; then
111+
RESULT+=","
112+
fi
113+
RESULT+="${tag}${SUFFIX}"
114+
done
115+
116+
echo "TAGS_WITH_SUFFIX=$RESULT" >> $GITHUB_ENV
117+
101118
- name: Build and push Docker image
102119
uses: docker/build-push-action@v6
103120
with:
104121
context: .
105122
file: docker/Dockerfile
106123
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
107124
push: true
108-
tags: ${{ steps.meta.outputs.tags }}${{ matrix.variant.tag_suffix }}
125+
tags: ${{ env.TAGS_WITH_SUFFIX }}
109126
labels: ${{ steps.meta.outputs.labels }}
110127
annotations: ${{ steps.meta.outputs.annotations }}
111128
build-args: |

0 commit comments

Comments
 (0)