mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2026-09-03 05:10:26 +03:00
ci(fix): use build artifacts to speed up image generation
This commit is contained in:
@@ -25,8 +25,16 @@ jobs:
|
||||
- script: 'yarn build'
|
||||
displayName: 'Build'
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Publish Generated Static Pages as Artifact'
|
||||
inputs:
|
||||
targetPath: $(System.DefaultWorkingDirectory)/dist
|
||||
artifactName: dist
|
||||
|
||||
- job: BuildDocker
|
||||
displayName: 'Build Docker Images'
|
||||
dependsOn: Build
|
||||
condition: succeeded()
|
||||
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
@@ -34,24 +42,31 @@ jobs:
|
||||
variables:
|
||||
- name: DOCKER_CLI_EXPERIMENTAL
|
||||
value: 'enabled'
|
||||
|
||||
- name: Version
|
||||
value: $[replace(variables['Build.SourceBranch'],'refs/tags/v','')]
|
||||
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Artifact from Build Job'
|
||||
inputs:
|
||||
source: current
|
||||
artifact: dist
|
||||
path: $(System.DefaultWorkingDirectory)/dist
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Register Qemu Binfmt and Docker Buildx Builder'
|
||||
inputs:
|
||||
script: |
|
||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
docker buildx create --name builder
|
||||
docker buildx use builder
|
||||
docker buildx create --use
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Build PR Docker Image'
|
||||
condition: startsWith(variables['System.PullRequest.TargetBranch'], 'master')
|
||||
inputs:
|
||||
script: |
|
||||
docker buildx build --no-cache \
|
||||
docker buildx build --file ./Dockerfile.dev --no-cache \
|
||||
--platform linux/arm,linux/arm64,linux/amd64 \
|
||||
--tag pr-$(System.PullRequest.PullRequestId) .
|
||||
|
||||
@@ -60,7 +75,7 @@ jobs:
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||
inputs:
|
||||
script: |
|
||||
docker buildx build --no-cache --push \
|
||||
docker buildx build --file ./Dockerfile.dev --no-cache --push \
|
||||
--platform linux/arm,linux/arm64,linux/amd64 \
|
||||
--tag jellyfin/jellyfin-vue:unstable-$(Build.BuildNumber) \
|
||||
--tag jellyfin/jellyfin-vue:unstable .
|
||||
@@ -70,7 +85,7 @@ jobs:
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||
inputs:
|
||||
script: |
|
||||
docker buildx build --no-cache --push \
|
||||
docker buildx build --file ./Dockerfile.dev --no-cache --push \
|
||||
--platform linux/arm,linux/arm64,linux/amd64 \
|
||||
--tag jellyfin/jellyfin-vue:$(Version) \
|
||||
--tag jellyfin/jellyfin-vue:stable \
|
||||
|
||||
+1
-3
@@ -1,5 +1,6 @@
|
||||
# Dockerfile
|
||||
Dockerfile
|
||||
Dockerfile.dev
|
||||
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Node template
|
||||
@@ -71,9 +72,6 @@ typings/
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# Nuxt generate
|
||||
dist
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM node:13-alpine AS build
|
||||
FROM node:12-alpine AS build
|
||||
|
||||
# Install build dependencies for node modules
|
||||
RUN apk add git python make g++
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM nginx:alpine
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
COPY .docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY .docker/mime.types /etc/nginx/mime.types
|
||||
Reference in New Issue
Block a user