Skip to content

Commit

Permalink
added to have the branch to be complete
Browse files Browse the repository at this point in the history
  • Loading branch information
romer8 committed May 6, 2024
1 parent c59715b commit aeedc1c
Showing 1 changed file with 6 additions and 71 deletions.
77 changes: 6 additions & 71 deletions .github/workflows/build_and_push_dev_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix={{ .Branch }}-
suffix=-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -48,8 +52,8 @@ jobs:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:dev-cache
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:dev-cache,mode=max
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}
cache-to: type=registry,ref=${{ steps.meta.outputs.tags }},mode=max
- name: Export digest
run: |
mkdir -p /tmp/digests
Expand Down Expand Up @@ -94,72 +98,3 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
# # A workflow run is made up of one or more jobs that can run sequentially or in parallel
# jobs:
# setup:
# runs-on: ubuntu-latest
# outputs:
# matrix: ${{ steps.set-matrix.outputs.matrix }}
# steps:
# - name: Set Tag
# run: |
# echo "TAG=dev_${GITHUB_SHA}" >> $GITHUB_ENV
# echo "TAG_LATEST=dev_latest" >> $GITHUB_ENV
# - name: Set matrix for build
# id: set-matrix
# run: echo "::set-output name=matrix::{\"include\":[{\"platform\":\"linux/amd64\",\"tag\":\"${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}:dev_latest-amd64\"},{\"platform\":\"linux/arm64\",\"tag\":\"${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}:dev_latest-arm64\"}]}"
# # build image
# build:
# needs: setup
# runs-on: ubuntu-latest
# strategy:
# matrix: ${{fromJson(needs.setup.outputs.matrix)}}
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v4

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

# - name: Set Tag
# run: |
# echo "TAG=dev_${GITHUB_SHA}" >> $GITHUB_ENV
# echo "TAG_LATEST=dev_latest" >> $GITHUB_ENV

# - name: Test Tag
# run: |
# echo $TAG

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_BUILDER_USERNAME }}
# password: ${{ secrets.DOCKER_BUILDER_TOKEN }}

# - name: Build and push specific architecture
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./Dockerfile
# push: true
# tags: ${{ matrix.tag }}
# platforms: ${{ matrix.platform }}
# cache-from: type=registry,ref=${{ matrix.tag }}-cache:latest
# cache-to: type=registry,ref=${{ matrix.tag }}-cache:latest,mode=max

# cleanup:
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: only keeps the first 5 image
# run: |
# echo "TAG=dev_${GITHUB_SHA}" >> $GITHUB_ENV
# echo $TAG
# echo "MAX_NUMBER_IMAGE=10" >> $GITHUB_ENV
# echo $MAX_NUMBER_IMAGE
# . .github/scripts/clean_up_docker_hub.sh '${{ secrets.DOCKER_BUILDER_USERNAME }}' '${{ secrets.DOCKER_BUILDER_TOKEN }}' '${{ env.DOCKER_HUB_ORG }}' '${{ env.DOCKER_REPO }}' '${{ env.MAX_NUMBER_IMAGE }}'

0 comments on commit aeedc1c

Please sign in to comment.