sand-and-bone/.gitlab-ci.yml

55 lines
1.9 KiB
YAML
Raw Normal View History

2018-08-26 06:56:18 +00:00
image: dmoonfire/mfgames-writing-js:1.1.1
stages:
- publish
publish:
stage: publish
tags:
- docker
script:
# Install the basic requirements including the free fonts.
- npm ci
# Verify that the commits are good.
- npx commitlint --from=master to=CI_BUILD_REF_NAME
# Corda is a non-free font that we use for the books. It was
# picked before Source Serif Pro was created and will continue to
# be used until SSP can handle proper italics. To get around this,
# we stored it in a secret location that Gitlab CI knows about but
# everyone else does not.
- wget $CORDA_FONTS_URL/$CORDA_FONTS_BZ2BALL
- tar -xjf $CORDA_FONTS_BZ2BALL
- mkdir -p ~/.fonts/
- mv *.otf ~/.fonts/
- fc-cache -rf
2018-08-26 07:16:43 +00:00
# We need the covers and the previous version so we can generate the
# "previously" chapter.
2018-08-26 06:56:18 +00:00
- mkdir -p build/repos
- git clone https://oauth2:$fedranAccessKey@gitlab.com/fedran/fedran-covers.git build/repos/fedran-covers
2018-08-26 07:16:43 +00:00
- git clone https://oauth2:$fedranAccessKey@gitlab.com/fedran/sand-and-blood.git build/repos/sand-and-ash
- 'echo "---" > build/previously.markdown'
- 'echo "title: Previously" >> build/previously.markdown'
- 'echo "---" >> build/previously.markdown'
- 'cat build/repos/sand-and-ash/spoilers/plot.markdown >> build/previously.markdown'
2018-08-26 06:56:18 +00:00
# Trigger the release if needed.
- npx semantic-release
# Build the files.
- npm run build
# Trigger the Fedran website to rebuild.
- "curl -X POST -F token=$fedranAccessKey -F ref=master https://gitlab.com/api/v4/projects/4027285/trigger/pipeline"
artifacts:
expire_in: 1 week
paths:
- "*.pdf"
- "*.epub"
- "*.mobi"
- "*.docx"
- "*.html"