Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Updating docker workflows (#495)

Robbie Davis21eb751c39a6
diff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.yml
deleted file mode 100644
index bdde18908..000000000
--- a/.github/workflows/nightly-docker.yml
+++ /dev/null
@@ -1,93 +0,0 @@
-name: Build Nightly Docker
-
-on:
- workflow_dispatch:
- inputs:
- title:
- description: "PR Title"
- required: true
- default: ""
-
-jobs:
- docker:
- name: Building Nightly Docker
- runs-on: ubuntu-latest
- steps:
-
- - name: Check Out Repo
- uses: actions/checkout@v2
- with:
- ref: develop
-
- - name: NodeJS to Compile WebUI
- uses: actions/[email protected]
- with:
- node-version: '14'
- - run: |
- cd UI/Web || exit
- echo 'Installing web dependencies'
- npm install
-
- echo 'Building UI'
- npm run prod
-
- echo 'Copying back to Kavita wwwroot'
- rsync -a dist/ ../../API/wwwroot/
-
- cd ../ || exit
-
- - name: Get csproj Version
- uses: naminodarie/get-net-sdk-project-versions-action@v1
- id: get-version
- with:
- proj-path: Kavita.Common/Kavita.Common.csproj
-
- - name: Echo csproj version
- run: echo "${{steps.get-version.outputs.assembly-version}}"
-
- - name: Compile dotnet app
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: '5.0.x'
- - run: ./monorepo-build.sh
-
- - name: Trigger Sentry workflow
- uses: benc-uk/workflow-dispatch@v1
- with:
- workflow: Sentry Map Release
- token: ${{ secrets.REPO_GHA_PAT }}
- inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }'
-
- - name: Login to Docker Hub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKER_HUB_USERNAME }}
- password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Build and push
- id: docker_build
- uses: docker/build-push-action@v2
- with:
- context: .
- platforms: linux/amd64,linux/arm/v7,linux/arm64
- push: true
- tags: kizaing/kavita:nightly
-
- - name: Image digest
- run: echo ${{ steps.docker_build.outputs.digest }}
-
- - name: Notify Discord
- uses: rjstone/discord-webhook-notify@v1
- with:
- severity: info
- description: v${{steps.get-version.outputs.assembly-version}} - ${{ github.event.inputs.title }}
- details: '${{ steps.parse-body.outputs.BODY }}'
- text: A new nightly build has been released for docker.
- webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml
index f17d7539b..eb688ef39 100644
--- a/.github/workflows/sonar-scan.yml
+++ b/.github/workflows/sonar-scan.yml
@@ -215,20 +215,117 @@ jobs:
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
- description: v${{steps.get-version.outputs.assembly-version}} - ${{ github.event.inputs.title }}
+ description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }}
details: '${{ steps.parse-body.outputs.BODY }}'
text: A new nightly build has been released for docker.
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
stable:
- name: Trigger Stable Docker if Main push
+ name: Build Stable Docker if Main push
needs: [ build, test ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- - name: If Push to Main, Trigger Docker Stable
+ - name: Find Current Pull Request
+ uses: jwalton/[email protected]
+ id: findPr
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Parse PR body
+ id: parse-body
+ run: |
+ body='${{ steps.findPr.outputs.body }}'
+ body="${body//'%'/'%25'}"
+ body="${body//$'\n'/'%0A'}"
+ body="${body//$'\r'/'%0D'}"
+ echo $body
+ echo "::set-output name=BODY::$body"
+
+ - name: Check Out Repo
+ uses: actions/checkout@v2
+ with:
+ ref: main
+
+ - name: NodeJS to Compile WebUI
+ uses: actions/[email protected]
+ with:
+ node-version: '14'
+ - run: |
+
+ cd UI/Web || exit
+ echo 'Installing web dependencies'
+ npm install
+
+ echo 'Building UI'
+ npm run prod
+
+ echo 'Copying back to Kavita wwwroot'
+ rsync -a dist/ ../../API/wwwroot/
+
+ cd ../ || exit
+
+ - name: Get csproj Version
+ uses: naminodarie/get-net-sdk-project-versions-action@v1
+ id: get-version
+ with:
+ proj-path: Kavita.Common/Kavita.Common.csproj
+
+ - name: Echo csproj version
+ run: echo "${{steps.get-version.outputs.assembly-version}}"
+
+ - name: Parse Version
+ run: |
+ version='${{steps.get-version.outputs.assembly-version}}'
+ newVersion=${version%.*}
+ echo $newVersion
+ echo "::set-output name=VERSION::$newVersion"
+ id: parse-version
+
+ - name: Compile dotnet app
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '5.0.x'
+ - run: ./monorepo-build.sh
+
+ - name: Trigger Sentry workflow
uses: benc-uk/workflow-dispatch@v1
with:
- workflow: Build Stable Docker
- token: ${{ secrets.REPO_GHA_PAT }}
\ No newline at end of file
+ workflow: Sentry Map Release
+ token: ${{ secrets.REPO_GHA_PAT }}
+ inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }'
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_HUB_USERNAME }}
+ password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+
+ - name: Set up Docker Buildx
+ id: buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: Build and push
+ id: docker_build
+ uses: docker/build-push-action@v2
+ with:
+ context: .
+ platforms: linux/amd64,linux/arm/v7,linux/arm64
+ push: true
+ tags: kizaing/kavita:latest, kizaing/kavita:${{ steps.parse-version.outputs.VERSION }}
+
+ - name: Image digest
+ run: echo ${{ steps.docker_build.outputs.digest }}
+
+ - 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.parse-body.outputs.BODY }}'
+ text: A new stable build has been released.
+ webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
diff --git a/.github/workflows/stable-docker.yml b/.github/workflows/stable-docker.yml
deleted file mode 100644
index cea58295b..000000000
--- a/.github/workflows/stable-docker.yml
+++ /dev/null
@@ -1,96 +0,0 @@
-name: Build Stable Docker
-
-on:
- workflow_dispatch:
-
-jobs:
- docker:
- runs-on: ubuntu-latest
- steps:
-
- - name: Check Out Repo
- uses: actions/checkout@v2
- with:
- ref: main
-
- - name: NodeJS to Compile WebUI
- uses: actions/[email protected]
- with:
- node-version: '14'
- - run: |
-
- cd UI/Web || exit
- echo 'Installing web dependencies'
- npm install
-
- echo 'Building UI'
- npm run prod
-
- echo 'Copying back to Kavita wwwroot'
- rsync -a dist/ ../../API/wwwroot/
-
- cd ../ || exit
-
- - name: Get csproj Version
- uses: naminodarie/get-net-sdk-project-versions-action@v1
- id: get-version
- with:
- proj-path: Kavita.Common/Kavita.Common.csproj
-
- - name: Echo csproj version
- run: echo "${{steps.get-version.outputs.assembly-version}}"
-
- - name: Parse Version
- run: |
- version='${{steps.get-version.outputs.assembly-version}}'
- newVersion=${version%.*}
- echo $newVersion
- echo "::set-output name=VERSION::$newVersion"
- id: parse-version
-
- - name: Compile dotnet app
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: '5.0.x'
- - run: ./monorepo-build.sh
-
- - name: Trigger Sentry workflow
- uses: benc-uk/workflow-dispatch@v1
- with:
- workflow: Sentry Map Release
- token: ${{ secrets.REPO_GHA_PAT }}
- inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }'
-
- - name: Login to Docker Hub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKER_HUB_USERNAME }}
- password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Build and push
- id: docker_build
- uses: docker/build-push-action@v2
- with:
- context: .
- platforms: linux/amd64,linux/arm/v7,linux/arm64
- push: true
- tags: kizaing/kavita:latest, kizaing/kavita:${{ steps.parse-version.outputs.VERSION }}
-
- - name: Image digest
- run: echo ${{ steps.docker_build.outputs.digest }}
-
- - name: Notify Discord
- uses: rjstone/discord-webhook-notify@v1
- with:
- severity: info
- description: ${{ github.event.body }}
- details: 'https://hub.docker.com/r/kizaing/kavita/tags?page=1&ordering=last_updated'
- text: A new stable build has been released for docker.
- webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
\ No newline at end of file