diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 46995c15..333672da 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -1,11 +1,5 @@ name: Analysis -on: - push: - branches: - - master - pull_request: - branches: - - master +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd47b7b8..5969ea76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,11 @@ name: Build - -on: - push: - branches: - - master +on: [push, pull_request] jobs: build: name: "${{matrix.artifact}}'s Build" runs-on: ${{matrix.os}} + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository strategy: fail-fast: false matrix: @@ -77,6 +74,7 @@ jobs: name: Create debian, rpm & arch releases runs-on: ubuntu-latest needs: build + if: github.ref == 'refs/heads/master' env: description: "A media browser" version: v0.0.1 #${{ github.ref }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..4a1be2ff --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,20 @@ +name: Docker + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - uses: actions/checkout@v2 + - name: Checkout submodules + run: git submodule update --init --recursive + - name: Push to GitHub Packages + uses: docker/build-push-action@v2 + with: + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + registry: docker.pkg.github.com + repository: AnonymusRaccoon/Kyoo/kyoo + tag_with_sha: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3baaa751..e62bb55a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Set commit environment + run: echo "COMMIT_SHA=$(git rev-list -n 1 ${{github.ref}})" >> $GITHUB_ENV - name: Wait for builds & tests to finish uses: lewagon/wait-on-check-action@v0.2 with: @@ -24,7 +26,7 @@ jobs: - name: Download artifacts uses: dawidd6/action-download-artifact@v2 with: - commit: ${{github.ref}} + commit: ${{env.COMMIT_SHA}} workflow: build.yml path: ./artifacts github_token: ${{secrets.GITHUB_TOKEN}} diff --git a/Dockerfile b/Dockerfile index df52760d..8764c7df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM gcc:latest as transcoder -RUN apt-get update && apt-get install -y cmake make +RUN apt-get update && apt-get install -y cmake make libavutil-dev libavcodec-dev libavformat-dev WORKDIR /transcoder -COPY transcoder . +COPY Kyoo.Transcoder . RUN cmake . && make -j FROM node:alpine as webapp @@ -15,6 +15,7 @@ COPY . . RUN dotnet publish -c Release -o /opt/kyoo '-p:SkipWebApp=true;SkipTranscoder=true' FROM mcr.microsoft.com/dotnet/aspnet:5.0 +RUN apt-get update && apt-get install -y libavutil-dev libavcodec-dev libavformat-dev EXPOSE 5000 COPY --from=builder /opt/kyoo /usr/lib/kyoo COPY --from=transcoder /transcoder/libtranscoder.so /usr/lib/kyoo