From 1c0b3c368d69b6b5ead9af908882d98d3e2f8eaa Mon Sep 17 00:00:00 2001 From: Avior Date: Fri, 30 Aug 2024 15:29:18 +0200 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 83 +------------------------------------ 1 file changed, 2 insertions(+), 81 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c23526d5..4f949206f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: ci +name: Build Docker image on: push: @@ -12,7 +12,6 @@ jobs: build: runs-on: ubuntu-latest strategy: - fail-fast: false matrix: platform: - linux/amd64 @@ -27,11 +26,6 @@ jobs: with: fetch-depth: 0 - - name: Prepare - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -78,79 +72,6 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha + push: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} cache-to: type=gha,mode=max - outputs: | - type=image,name=ghcr.io/tcgdex/server,push-by-digest=true,name-canonical=true - type=image,name=tcgdex/server,push-by-digest=true,name-canonical=true - - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM_PAIR }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - deploy: - runs-on: ubuntu-latest - name: Deploying TCGdex - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - needs: - - build - steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - tags: | - type=edge - type=ref,event=pr - type=ref,event=branch,prefix=branch- - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=semver,pattern=latest - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to Github Packages - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Create manifest list and push for each image - working-directory: /tmp/digests - run: | - echo "${{ env.REGISTRY_IMAGES }}" | while read image; do - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf "$image@sha256:%s " *); - done - - - name: Inspect image - run: | - echo "${{ env.REGISTRY_IMAGES }}" | while read image; do - docker buildx imagetools inspect $image:${{ steps.meta.outputs.version }}; - done