From 6b86e95317c9d420a614c365c71cb2a99b2562f9 Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Mon, 4 Sep 2023 14:18:41 -0400 Subject: [PATCH] test (#2267) --- .github/workflows/build-and-test.yml | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 376d34293..bc32560dc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -78,7 +78,7 @@ jobs: name: Bump version on Develop/Canary PR (and not coming from release/) needs: [ build ] runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'refs/heads/canary') && !startsWith(github.event.pull_request.head.ref, 'release/') + if: github.event_name == 'push' && (github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'refs/heads/canary') && !contains('release/', github.event.pull_request.head.ref) steps: - uses: actions/checkout@v3 with: @@ -106,13 +106,13 @@ jobs: develop: - name: Build Nightly Docker if Develop push + name: Build Nightly Docker if non-release push needs: [ build, version ] runs-on: ubuntu-latest permissions: packages: write contents: read - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' && !contains('release/', github.event.pull_request.head.ref}} steps: - name: Find Current Pull Request uses: jwalton/gh-find-current-pr@v1 @@ -230,13 +230,13 @@ jobs: webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} stable: - name: Build Stable Docker if Main push + name: Build Stable and Nightly Docker if Release needs: [ build ] runs-on: ubuntu-latest permissions: packages: write contents: read - if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.base.ref == 'develop' + if: github.event_name == 'pull_request' && contains('release/', github.event.pull_request.head.ref && github.event.pull_request.base.ref == 'develop' steps: - name: Find Current Pull Request @@ -336,7 +336,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - name: Build and push + - name: Build and push stable id: docker_build uses: docker/build-push-action@v4 with: @@ -345,6 +345,15 @@ jobs: 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 }} + - name: Build and push nightly + id: docker_build + uses: docker/build-push-action@v4 + 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 }} + - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} @@ -357,6 +366,15 @@ jobs: text: <@&939225192553644133> A new stable build has been released. webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} + - name: Notify Discord + uses: rjstone/discord-webhook-notify@v1 + with: + severity: info + description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }} + details: '${{ steps.findPr.outputs.body }}' + text: <@&939225459156217917> <@&939225350775406643> A new nightly build has been released for docker. + webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} + canary: name: Build Canary Docker if Canary push needs: [ build, version ]