From d09026f34aec5572e8e0777fc4e02310bf67461f Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Tue, 17 Dec 2019 23:13:02 -0600 Subject: [PATCH] ci: added Gitlab CI --- .gitignore | 4 ++++ .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitignore b/.gitignore index 310a999..9df9a3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ node_modules/ *.epub +*.mobi *.pdf +*.docx +*~ + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..bd5c9d8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,37 @@ +image: dmoonfire/mfgames-writing-js:2.0.0 + +stages: + - publish + +publish: + stage: publish + only: [master] + tags: [docker] + script: + # Install the basic requirements including the free fonts. + - npm ci + + # Verify that the commits are good. + - npx commitlint --from=$CI_BUILD_BEFORE_SHA + + # We need the cover from the general repository. + - mkdir -p build/repos + - git clone https://oauth2:$fedranAccessKey@gitlab.com/fedran/fedran-covers.git build/repos/fedran-covers + + # 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"