chore: fix building logic

* use after_script to generate badge
  - after_script executes after all jobs, including failed ones
* deploy_job and failed_job must upload artifacts
* pages job script cannot be empty
* pages job should always run
This commit is contained in:
curben 2019-06-12 19:43:28 +09:30
parent 3f802d9135
commit 12eadbf612
1 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,7 @@
stages:
- deploy_stage
- failed_stage
- pages_stage
image: alpine:latest # Use the latest version of Alpine Linux docker image
@ -46,6 +47,7 @@ deploy_job:
# Push the commit
- git push
after_script:
# Generate successful status badge
- mkdir -p /builds/curben/urlhaus-filter/public/
- wget https://img.shields.io/badge/pipeline-passed-success.svg -O /builds/curben/urlhaus-filter/public/status.svg
@ -80,3 +82,18 @@ failed_job:
- schedules
- web
pages:
stage: pages_stage
script:
- echo "Uploading status.svg to Pages..."
artifacts:
paths:
- public
when: always
only:
- schedules
- web