mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Feature/docker setup (#294)
* Github Action for Docker Integration on merge into develop Co-authored-by: Chris Plaatjes <chris.p@boxbrite.com>
This commit is contained in:
parent
8d8e7ce93b
commit
560b0c9cb5
35
.github/workflows/nightly-docker.yml
vendored
35
.github/workflows/nightly-docker.yml
vendored
@ -13,12 +13,39 @@ jobs:
|
||||
- name: Check Out Repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check Out WebUI
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Kareadita/Kavita-webui
|
||||
ref: feature/sentry-release
|
||||
path: Kavita-webui/
|
||||
|
||||
- name: NodeJS to Compile WebUI
|
||||
uses: actions/setup-node@v2.1.5
|
||||
with:
|
||||
node-version: '14'
|
||||
- run: |
|
||||
cd Kavita-webui/ || exit
|
||||
npm install
|
||||
npm run prod
|
||||
mv dist/ ../API/wwwroot
|
||||
cd ../ || exit
|
||||
|
||||
- name: Compile dotnet app
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
- run: ./action-build.sh
|
||||
|
||||
- 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
|
||||
@ -27,10 +54,10 @@ jobs:
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: true
|
||||
tags: kizaing/kavita:nightly-amd64
|
||||
tags: kizaing/kavita:nightly
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
83
action-build.sh
Executable file
83
action-build.sh
Executable file
@ -0,0 +1,83 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
outputFolder='_output'
|
||||
|
||||
ProgressStart()
|
||||
{
|
||||
echo "Start '$1'"
|
||||
}
|
||||
|
||||
ProgressEnd()
|
||||
{
|
||||
echo "Finish '$1'"
|
||||
}
|
||||
|
||||
Build()
|
||||
{
|
||||
local RID="$1"
|
||||
|
||||
ProgressStart "Build for $RID"
|
||||
|
||||
slnFile=Kavita.sln
|
||||
|
||||
dotnet clean $slnFile -c Debug
|
||||
dotnet clean $slnFile -c Release
|
||||
|
||||
dotnet msbuild -restore $slnFile -p:Configuration=Release -p:Platform="Any CPU" -p:RuntimeIdentifiers=$RID
|
||||
|
||||
ProgressEnd "Build for $RID"
|
||||
}
|
||||
|
||||
Package()
|
||||
{
|
||||
local framework="$1"
|
||||
local runtime="$2"
|
||||
local lOutputFolder=../_output/"$runtime"/Kavita
|
||||
|
||||
ProgressStart "Creating $runtime Package for $framework"
|
||||
|
||||
# TODO: Use no-restore? Because Build should have already done it for us
|
||||
echo "Building"
|
||||
cd API
|
||||
echo dotnet publish -c Release --no-restore --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework
|
||||
dotnet publish -c Release --no-restore --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework
|
||||
|
||||
echo "Copying Install information"
|
||||
cp ../INSTALL.txt "$lOutputFolder"/README.txt
|
||||
|
||||
echo "Copying LICENSE"
|
||||
cp ../LICENSE "$lOutputFolder"/LICENSE.txt
|
||||
|
||||
echo "Renaming API -> Kavita"
|
||||
mv "$lOutputFolder"/API "$lOutputFolder"/Kavita
|
||||
|
||||
echo "Creating tar"
|
||||
cd ../$outputFolder/"$runtime"/
|
||||
tar -czvf ../kavita-$runtime.tar.gz Kavita
|
||||
|
||||
ProgressEnd "Creating $runtime Package for $framework"
|
||||
|
||||
}
|
||||
|
||||
dir=$PWD
|
||||
|
||||
if [ -d _output ]
|
||||
then
|
||||
rm -r _output/
|
||||
fi
|
||||
|
||||
#Build for x64
|
||||
Build "linux-x64"
|
||||
Package "net5.0" "linux-x64"
|
||||
cd "$dir"
|
||||
|
||||
#Build for arm
|
||||
Build "linux-arm"
|
||||
Package "net5.0" "linux-arm"
|
||||
cd "$dir"
|
||||
|
||||
#Build for arm64
|
||||
Build "linux-arm64"
|
||||
Package "net5.0" "linux-arm64"
|
||||
cd "$dir"
|
0
copy_runtime.sh
Normal file → Executable file
0
copy_runtime.sh
Normal file → Executable file
@ -15,7 +15,7 @@ ProgressEnd()
|
||||
|
||||
Build()
|
||||
{
|
||||
local RID="$1"
|
||||
local RID="$1"
|
||||
|
||||
ProgressStart 'Build for $RID'
|
||||
|
||||
@ -24,8 +24,8 @@ Build()
|
||||
dotnet clean $slnFile -c Debug
|
||||
dotnet clean $slnFile -c Release
|
||||
|
||||
dotnet msbuild -restore $slnFile -p:Configuration=Release -p:Platform="Any CPU" -p:RuntimeIdentifiers=$RID
|
||||
|
||||
dotnet msbuild -restore $slnFile -p:Configuration=Release -p:Platform="Any CPU" -p:RuntimeIdentifiers=$RID
|
||||
|
||||
ProgressEnd 'Build for $RID'
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user