Skip to content

Commit

Permalink
ci: add tag by docker buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
mickamy committed Jan 7, 2024
1 parent ab5aa51 commit 1ac8131
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.language }}
${{ runner.os }}-buildx
- name: Build and push bench image
- name: Build bench image
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -63,7 +63,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
platforms: linux/amd64,linux/arm64/v8
- name: Build and push base image
- name: Build base image
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -72,13 +72,11 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
platforms: linux/amd64,linux/arm64/v8
- name: Add tags without UNAME
- name: Add tags without UNAME to bench and base images
run: |
docker tag ${{ env.UNAME }}/ishocon2-bench:latest ishocon2-bench:latest
docker tag ${{ env.UNAME }}/ishocon2-bench:${{ env.DATE }} ishocon2-bench:${{ env.DATE }}
docker tag ${{ env.UNAME }}/ishocon2-app-base:latest ishocon2-app-base:latest
docker tag ${{ env.UNAME }}/ishocon2-app-base:${{ env.DATE }} ishocon2-app-base:${{ env.DATE }}
- name: Build and push app image
docker buildx imagetools create --tag ishocon2-bench:latest ${{ env.UNAME }}/ishocon2-bench:latest
docker buildx imagetools create --tag ishocon2-app-base:latest ${{ env.UNAME }}/ishocon2-app-base:latest
- name: Build app image
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -87,6 +85,9 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
platforms: linux/amd64,linux/arm64/v8
- name: Add tags without UNAME to app image
run: |
docker buildx imagetools create --tag ishocon2-app-${{ env.ISHOCON_APP_LANG }}:latest ${{ env.UNAME }}/ishocon2-app-${{ env.ISHOCON_APP_LANG }}:latest
- run: make up bench-with-db-init
timeout-minutes: 10
- name: Dump docker logs
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/build_and_push_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,25 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ./docker/benchmarker/Dockerfile
tags: ${{ env.UNAME }}/ishocon2-bench:latest,${{ env.UNAME }}/ishocon2-bench:${{ env.DATE }},ishocon2-bench:latest,ishocon2-bench:${{ env.DATE }}
tags: ${{ env.UNAME }}/ishocon2-bench:latest,${{ env.UNAME }}/ishocon2-bench:${{ env.DATE }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
platforms: linux/amd64,linux/arm64/v8
- name: Build and push base image
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ./docker/app/base/Dockerfile
tags: ${{ env.UNAME }}/ishocon2-app-base:latest,${{ env.UNAME }}/ishocon2-app-base:${{ env.DATE }},ishocon2-app-base:latest,ishocon2-app-base:${{ env.DATE }}
tags: ${{ env.UNAME }}/ishocon2-app-base:latest,${{ env.UNAME }}/ishocon2-app-base:${{ env.DATE }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
platforms: linux/amd64,linux/arm64/v8
- name: Push bench and base images
- name: Add tag to base image
run: |
docker push ${{ env.UNAME }}/ishocon2-bench:latest
docker push ${{ env.UNAME }}/ishocon2-bench:${{ env.DATE }}
docker push ${{ env.UNAME }}/ishocon2-app-base:latest
docker push ${{ env.UNAME }}/ishocon2-app-base:${{ env.DATE }}
docker buildx imagetools create --tag ishocon2-app-base:latest ${{ env.UNAME }}/ishocon2-app-base:latest
- name: Move new cache to the place where to be cached
run: |
echo "Temporary fix for cleaning up old cache."
Expand Down

0 comments on commit 1ac8131

Please sign in to comment.