diff --git a/.github/workflows/release_docker.yml b/.github/workflows/release_docker.yml index 36da889..611b30c 100644 --- a/.github/workflows/release_docker.yml +++ b/.github/workflows/release_docker.yml @@ -6,14 +6,9 @@ on: - "v*" jobs: - build: + release_docker: name: Release Docker runs-on: ubuntu-latest - strategy: - matrix: - platforms: - - linux/amd64 - - linux/arm64 steps: - name: Checkout uses: actions/checkout@v4 @@ -39,11 +34,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Prepare - id: prepare - run: | - echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT - echo "TARFILE=${platforms//\//-}.tar" >> $GITHUB_OUTPUT + - name: Get version + id: get_version + run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT - name: Build and push id: docker_build @@ -51,58 +44,8 @@ jobs: with: context: . build-args: - VERSION=v${{ steps.prepare.outputs.VERSION }} + VERSION=v${{ steps.get_version.outputs.VERSION }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - platforms: ${{ matrix.platforms }} - outputs: type=docker,dest=/tmp/images/${{ steps.prepare.outputs.TARFILE }} - - - name: Upload image - uses: actions/upload-artifact@v4 - with: - name: images - path: /tmp/images/${{ steps.prepare.outputs.TARFILE }} - if-no-files-found: error - retention-days: 1 - - push: - runs-on: ubuntu-latest - needs: - - build - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - - name: Download images - uses: actions/download-artifact@v3 - with: - name: images - path: /tmp/images - - - name: Load images - run: | - for image in /tmp/images/*.tar; do - docker load -i $image - done - - - name: Push images to local registry - run: | - docker push -a ${{ env.TMP_LOCAL_IMAGE }} - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Create manifest list and push - run: | - docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:${{ env.REGISTRY_TAG }} \ - $(docker image ls --format '{{.Repository}}:{{.Tag}}' '${{ env.TMP_LOCAL_IMAGE }}' | tr '\n' ' ') - - - name: Inspect image - run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.REGISTRY_TAG }} \ No newline at end of file + platforms: linux/amd64,linux/arm64