Skip to content
Snippets Groups Projects
Verified Commit fcd96f52 authored by Lars Bilke's avatar Lars Bilke
Browse files

[ci] Deploy web site to netlify via cli.

parent 38413881
No related branches found
No related tags found
No related merge requests found
[build]
base = "web"
publish = "web/public"
command = """
git lfs install
git lfs pull
yarn --ignore-engines --ignore-optional --non-interactive
hugo
node_modules/.bin/hugo-algolia --toml -s"""
[build.environment] # global variables
HUGO_VERSION = "0.64.1"
GIT_LFS_ENABLED = "true"
[context.production.environment]
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
command = """
git lfs install
git lfs pull
yarn --ignore-engines --ignore-optional --non-interactive
hugo -b $DEPLOY_PRIME_URL"""
[context.branch-deploy]
command = """
git lfs install
git lfs pull
yarn --ignore-engines --ignore-optional --non-interactive
hugo -b $DEPLOY_PRIME_URL"""
[[redirects]]
from = "/papers"
to = "https://www.ufz.de/index.php?en=37204"
...@@ -15,7 +15,7 @@ web url checker: ...@@ -15,7 +15,7 @@ web url checker:
--white-listed-urls https://jenkins.opengeosys.org/job/ufz/job/ogs-container-maker/job/master/build,http://yourproxy.example.com,https://apt.kitware.com/ubuntu/,https://github.com/YOUR-USERNAME/ogs,https://jenkins.opengeosys.org/github-webhook/,http://localhost:1313,https://github.com/ufz/ogs/pull/\$1,http://www.opengeosys.org/images/xsd/OpenGeoSysXXX.xsd,https://\`-protocol --white-listed-urls https://jenkins.opengeosys.org/job/ufz/job/ogs-container-maker/job/master/build,http://yourproxy.example.com,https://apt.kitware.com/ubuntu/,https://github.com/YOUR-USERNAME/ogs,https://jenkins.opengeosys.org/github-webhook/,http://localhost:1313,https://github.com/ufz/ogs/pull/\$1,http://www.opengeosys.org/images/xsd/OpenGeoSysXXX.xsd,https://\`-protocol
content content
build web site: preview web site:
stage: build stage: build
image: $WEB_IMAGE image: $WEB_IMAGE
script: script:
...@@ -25,6 +25,7 @@ build web site: ...@@ -25,6 +25,7 @@ build web site:
- yarn - yarn
- hugo --environment staging - hugo --environment staging
rules: rules:
- if: '$CI_COMMIT_BRANCH != "master"'
- changes: - changes:
- web/ - web/
artifacts: artifacts:
...@@ -36,3 +37,19 @@ build web site: ...@@ -36,3 +37,19 @@ build web site:
cache: cache:
paths: paths:
- web/node_modules - web/node_modules
deploy web site:
stage: package
image: $WEB_IMAGE
script:
- cd web
- yarn
- hugo
- netlify deploy --prod --dir=public
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- changes:
- web/
cache:
paths:
- web/node_modules
...@@ -8,6 +8,7 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ ...@@ -8,6 +8,7 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y yarn \ && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y yarn \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN yarn global add netlify-cli
ENV HUGO_VERSION=0.72.0 ENV HUGO_VERSION=0.72.0
RUN curl -fSL -O "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb" \ RUN curl -fSL -O "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb" \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y /hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \ && DEBIAN_FRONTEND=noninteractive apt-get install -y /hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
......
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
/help/documentation/* https://ogs5-keywords.netlify.com /help/documentation/* https://ogs5-keywords.netlify.com
/project/license https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/LICENSE.txt /project/license https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/LICENSE.txt
/papers https://www.ufz.de/index.php?en=37204
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment