feat: move all build steps to multi-stage docker image build

This commit is contained in:
kolaente 2022-08-03 19:39:18 +02:00
parent abf6e0f447
commit 7c502d6136
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 18 additions and 19 deletions

View File

@ -6,24 +6,6 @@ trigger:
- push
steps:
- name: theme
image: kolaente/toolbox
pull: true
group: build-static
commands:
- mkdir themes/vikunja -p
- cd themes/vikunja
- wget https://dl.vikunja.io/theme/vikunja-theme.tar.gz
- tar -xzf vikunja-theme.tar.gz
- name: build
image: klakegg/hugo:0.99.1
pull: true
commands:
- rm -rf public
- hugo
- cat public/index.html
- name: docker
image: plugins/docker
pull: true

View File

@ -1,3 +1,20 @@
FROM kolaente/toolbox AS build-theme
COPY . /web
WORKDIR /web
RUN mkdir /web/themes/vikunja -p && \
cd /web/themes/vikunja && \
wget https://dl.vikunja.io/theme/vikunja-theme.tar.gz && \
tar -xzf vikunja-theme.tar.gz
FROM klakegg/hugo:0.99.1 as builder
COPY . /web
WORKDIR /web
COPY --from=build-theme /web/themes /web/themes
RUN rm -rf public && hugo
FROM nginx
ADD public /usr/share/nginx/html
COPY --from=builder /web/public /usr/share/nginx/html
ADD nginx.conf /etc/nginx/nginx.conf