From 171aa7c307161a2359971fbe070c88b7ff0a56b9 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Tue, 12 Aug 2025 19:26:50 -0700 Subject: [PATCH 1/4] Parse newlines in the output tags and the input tags... --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bfa54e6..298fd8d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,12 +118,13 @@ jobs: - name: Create and push Docker manifest run: | - TAGS="$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ' ')" + OUTPUT_TAGS="$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ' ')" + INPUT_TAGS="$(echo "${{ steps.arch-meta.outputs.tags }}" | tr '\n' ' ')" TAG_ARGS="" - for tag in $TAGS; do + for tag in $OUTPUT_TAGS; do TAG_ARGS="$TAG_ARGS --tag $tag" done - docker buildx imagetools create $TAG_ARGS ${{ steps.arch-meta.outputs.tags }} + docker buildx imagetools create $TAG_ARGS $INPUT_TAGS - name: Checkout code uses: actions/checkout@v4 From 00fc00a1ae6448432cd8f18e5ee346868a6332b3 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Tue, 12 Aug 2025 19:27:49 -0700 Subject: [PATCH 2/4] this will fail but faster --- .github/workflows/build.yml | 156 ++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 298fd8d3..ea875421 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,89 +5,89 @@ on: branches: ["**"] jobs: - build-amd64: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: audius/api - tags: | - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-amd64 - type=sha,prefix=,suffix=-amd64 - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=audius/api:buildcache-amd64 - cache-to: type=registry,ref=audius/api:buildcache-amd64,mode=max - build-args: | - GIT_SHA=${{ github.sha }} - platforms: linux/amd64 - - build-arm64: - runs-on: ubuntu-24.04-arm - permissions: - contents: write - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: audius/api - tags: | - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-arm64 - type=sha,prefix=,suffix=-arm64 - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=audius/api:buildcache-arm64 - cache-to: type=registry,ref=audius/api:buildcache-arm64,mode=max - build-args: | - GIT_SHA=${{ github.sha }} - platforms: linux/arm64 + # build-amd64: + # runs-on: ubuntu-latest + # permissions: + # contents: write + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Login to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + + # - name: Extract metadata for Docker + # id: meta + # uses: docker/metadata-action@v5 + # with: + # images: audius/api + # tags: | + # type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-amd64 + # type=sha,prefix=,suffix=-amd64 + + # - name: Build and push + # uses: docker/build-push-action@v5 + # with: + # context: . + # push: true + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + # cache-from: type=registry,ref=audius/api:buildcache-amd64 + # cache-to: type=registry,ref=audius/api:buildcache-amd64,mode=max + # build-args: | + # GIT_SHA=${{ github.sha }} + # platforms: linux/amd64 + + # build-arm64: + # runs-on: ubuntu-24.04-arm + # permissions: + # contents: write + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Login to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + + # - name: Extract metadata for Docker + # id: meta + # uses: docker/metadata-action@v5 + # with: + # images: audius/api + # tags: | + # type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-arm64 + # type=sha,prefix=,suffix=-arm64 + + # - name: Build and push + # uses: docker/build-push-action@v5 + # with: + # context: . + # push: true + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + # cache-from: type=registry,ref=audius/api:buildcache-arm64 + # cache-to: type=registry,ref=audius/api:buildcache-arm64,mode=max + # build-args: | + # GIT_SHA=${{ github.sha }} + # platforms: linux/arm64 push-manifest: runs-on: ubuntu-latest permissions: contents: write - needs: [build-amd64, build-arm64] + # needs: [build-amd64, build-arm64] steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 947cefd28e5e8dec2c6818704b962a0391448187 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Tue, 12 Aug 2025 19:28:44 -0700 Subject: [PATCH 3/4] Revert "this will fail but faster" This reverts commit 00fc00a1ae6448432cd8f18e5ee346868a6332b3. --- .github/workflows/build.yml | 156 ++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea875421..298fd8d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,89 +5,89 @@ on: branches: ["**"] jobs: - # build-amd64: - # runs-on: ubuntu-latest - # permissions: - # contents: write - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - - # - name: Login to DockerHub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - # - name: Extract metadata for Docker - # id: meta - # uses: docker/metadata-action@v5 - # with: - # images: audius/api - # tags: | - # type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-amd64 - # type=sha,prefix=,suffix=-amd64 - - # - name: Build and push - # uses: docker/build-push-action@v5 - # with: - # context: . - # push: true - # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} - # cache-from: type=registry,ref=audius/api:buildcache-amd64 - # cache-to: type=registry,ref=audius/api:buildcache-amd64,mode=max - # build-args: | - # GIT_SHA=${{ github.sha }} - # platforms: linux/amd64 - - # build-arm64: - # runs-on: ubuntu-24.04-arm - # permissions: - # contents: write - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - - # - name: Login to DockerHub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - # - name: Extract metadata for Docker - # id: meta - # uses: docker/metadata-action@v5 - # with: - # images: audius/api - # tags: | - # type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-arm64 - # type=sha,prefix=,suffix=-arm64 - - # - name: Build and push - # uses: docker/build-push-action@v5 - # with: - # context: . - # push: true - # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} - # cache-from: type=registry,ref=audius/api:buildcache-arm64 - # cache-to: type=registry,ref=audius/api:buildcache-arm64,mode=max - # build-args: | - # GIT_SHA=${{ github.sha }} - # platforms: linux/arm64 + build-amd64: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: audius/api + tags: | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-amd64 + type=sha,prefix=,suffix=-amd64 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=audius/api:buildcache-amd64 + cache-to: type=registry,ref=audius/api:buildcache-amd64,mode=max + build-args: | + GIT_SHA=${{ github.sha }} + platforms: linux/amd64 + + build-arm64: + runs-on: ubuntu-24.04-arm + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: audius/api + tags: | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }},suffix=-arm64 + type=sha,prefix=,suffix=-arm64 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=audius/api:buildcache-arm64 + cache-to: type=registry,ref=audius/api:buildcache-arm64,mode=max + build-args: | + GIT_SHA=${{ github.sha }} + platforms: linux/arm64 push-manifest: runs-on: ubuntu-latest permissions: contents: write - # needs: [build-amd64, build-arm64] + needs: [build-amd64, build-arm64] steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 843b53f23763e048188b514a981c03d5f2a1d029 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Tue, 12 Aug 2025 19:29:09 -0700 Subject: [PATCH 4/4] Keep an echo for safe keeping --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 298fd8d3..5c7fc2ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,6 +124,7 @@ jobs: for tag in $OUTPUT_TAGS; do TAG_ARGS="$TAG_ARGS --tag $tag" done + echo "docker buildx imagetools create $TAG_ARGS $INPUT_TAGS" docker buildx imagetools create $TAG_ARGS $INPUT_TAGS - name: Checkout code