diff --git a/.github/workflows/develop-workflow.yml b/.github/workflows/develop-workflow.yml index b7f229b14..939cda4e5 100644 --- a/.github/workflows/develop-workflow.yml +++ b/.github/workflows/develop-workflow.yml @@ -128,7 +128,7 @@ jobs: - name: Compile dotnet app uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 8.0.x - name: Install Swashbuckle CLI run: dotnet tool install -g Swashbuckle.AspNetCore.Cli @@ -137,6 +137,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 + if: ${{ github.repository_owner == 'Kareadita' }} with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} @@ -155,20 +156,33 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 + - name: Extract metadata (tags, labels) for Docker + id: docker_meta_nightly + uses: docker/metadata-action@v5 + with: + tags: | + type=raw,value=nightly + type=raw,value=nightly-${{ steps.parse-version.outputs.VERSION }} + images: | + name=jvmilazz0/kavita,enable=${{ github.repository_owner == 'Kareadita' }} + name=ghcr.io/${{ github.repository }} + - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true - tags: jvmilazz0/kavita:nightly, jvmilazz0/kavita:nightly-${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:nightly, ghcr.io/kareadita/kavita:nightly-${{ steps.parse-version.outputs.VERSION }} + tags: ${{ steps.docker_meta_nightly.outputs.tags }} + labels: ${{ steps.docker_meta_nightly.outputs.labels }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} - name: Notify Discord uses: rjstone/discord-webhook-notify@v1 + if: ${{ github.repository_owner == 'Kareadita' }} with: severity: info description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }} diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 251683b6c..95e4dc7e3 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -114,6 +114,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 + if: ${{ github.repository_owner == 'Kareadita' }} with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} @@ -132,23 +133,47 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 + - name: Extract metadata (tags, labels) for Docker + id: docker_meta_stable + uses: docker/metadata-action@v5 + with: + tags: | + type=raw,value=latest + type=raw,value=${{ steps.parse-version.outputs.VERSION }} + images: | + name=jvmilazz0/kavita,enable=${{ github.repository_owner == 'Kareadita' }} + name=ghcr.io/${{ github.repository }} + - name: Build and push stable id: docker_build_stable - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true - tags: jvmilazz0/kavita:latest, jvmilazz0/kavita:${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:latest, ghcr.io/kareadita/kavita:${{ steps.parse-version.outputs.VERSION }} + tags: ${{ steps.docker_meta_stable.outputs.tags }} + labels: ${{ steps.docker_meta_stable.outputs.labels }} + + - name: Extract metadata (tags, labels) for Docker + id: docker_meta_nightly + uses: docker/metadata-action@v5 + with: + tags: | + type=raw,value=nightly + type=raw,value=nightly-${{ steps.parse-version.outputs.VERSION }} + images: | + name=jvmilazz0/kavita,enable=${{ github.repository_owner == 'Kareadita' }} + name=ghcr.io/${{ github.repository }} - name: Build and push nightly id: docker_build_nightly - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true - tags: jvmilazz0/kavita:nightly, jvmilazz0/kavita:nightly-${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:nightly, ghcr.io/kareadita/kavita:nightly-${{ steps.parse-version.outputs.VERSION }} + tags: ${{ steps.docker_meta_nightly.outputs.tags }} + labels: ${{ steps.docker_meta_nightly.outputs.labels }} - name: Image digest run: echo ${{ steps.docker_build_stable.outputs.digest }}