diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d7502870873fe..dd63a248a4f18 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -243,25 +243,6 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} -# - name: Generate docker image tags -# id: metadata -# uses: docker/metadata-action@v5 -# with: -# flavor: | -# # Disable latest tag -# latest=false -# images: | -# name=ghcr.io/${{ github.repository_owner }}/${{env.image}} -# name=altran1502/${{env.image}},enable=${{ github.event_name == 'release' }} -# tags: | -# # Tag with branch name -# type=ref,event=branch,suffix=${{ matrix.suffix }} -# # Tag with pr-number -# type=ref,event=pr,suffix=${{ matrix.suffix }} -# # Tag with git tag on release -# type=ref,event=tag,suffix=${{ matrix.suffix }} -# type=raw,value=release,enable=${{ github.event_name == 'release' }},suffix=${{ matrix.suffix }} - - name: Determine build cache output id: cache-target run: | @@ -307,59 +288,79 @@ jobs: if-no-files-found: error retention-days: 1 -# merge: -# runs-on: ubuntu-latest -# needs: -# - build -# steps: -# - name: Download digests -# uses: actions/download-artifact@v4 -# with: -# path: ${{ runner.temp }}/digests -# pattern: digests-* -# merge-multiple: true -# + merge_server: + runs-on: ubuntu-latest + needs: + - build_and_push_server + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + # - name: Login to Docker Hub # uses: docker/login-action@v3 # with: # username: ${{ vars.DOCKERHUB_USERNAME }} # password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: Login to GHCR -# uses: docker/login-action@v3 -# with: -# registry: ghcr.io -# username: ${{ github.repository_owner }} -# password: ${{ secrets.GITHUB_TOKEN }} -# -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # - name: Docker meta -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.DOCKERHUB_REPO }} -# ${{ env.GHCR_REPO }} -# tags: | -# type=ref,event=branch -# type=ref,event=pr -# type=semver,pattern={{version}} -# type=semver,pattern={{major}}.{{minor}} -# -# - name: Create manifest list and push -# working-directory: ${{ runner.temp }}/digests -# run: | -# docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ -# $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) -# docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ -# $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) -# -# - name: Inspect image -# run: | -# docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }} -# docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }} +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# # ${{ env.DOCKERHUB_REPO }} +# ${{ env.GHCR_REPO }} +# tags: | +# type=ref,event=branch +# type=ref,event=pr +# type=semver,pattern={{version}} +# type=semver,pattern={{major}}.{{minor}} + + - name: Generate docker image tags + id: meta + uses: docker/metadata-action@v5 + with: + flavor: | + # Disable latest tag + latest=false + images: | + name=ghcr.io/${{ github.repository_owner }}/immich-server + # name=altran1502/immich-server,enable=${{ github.event_name == 'release' }} + tags: | + # Tag with branch name + type=ref,event=branch,suffix=${{ matrix.suffix }} + # Tag with pr-number + type=ref,event=pr,suffix=${{ matrix.suffix }} + # Tag with git tag on release + type=ref,event=tag,suffix=${{ matrix.suffix }} + type=raw,value=release,enable=${{ github.event_name == 'release' }},suffix=${{ matrix.suffix }} + + # docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + # $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) + + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }} + docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }} success-check-server: name: Docker Build & Push Server Success