CI: Only update image on new releases
This commit is contained in:
parent
d725d2a1ce
commit
4067aa74b2
18
.drone.yml
18
.drone.yml
@ -24,6 +24,23 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- submodules
|
- submodules
|
||||||
|
|
||||||
|
- name: Check for new posts
|
||||||
|
image: klakegg/hugo:alpine
|
||||||
|
pull: always
|
||||||
|
commands:
|
||||||
|
# If this is a cronjob and there are no new pages to publish fail successfully (exit status 78)
|
||||||
|
- export TIMESTAMP_YESTERDAY=$(date -d @$(($(date +%s) - 86400)) -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
- export POST_YESTERDAY=$(hugo list future --clock $TIMESTAMP_YESTERDAY | md5sum)
|
||||||
|
- export POST_TODAY=$(hugo list future | md5sum)
|
||||||
|
- if [ "$POST_YESTERDAY" = "$POST_TODAY" ]; then exit 78; fi
|
||||||
|
- exit 0
|
||||||
|
depends_on:
|
||||||
|
- Compress Images
|
||||||
|
- submodules
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- cron
|
||||||
|
|
||||||
- name: Build HTML
|
- name: Build HTML
|
||||||
image: klakegg/hugo:alpine
|
image: klakegg/hugo:alpine
|
||||||
commands:
|
commands:
|
||||||
@ -31,6 +48,7 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- Compress Images
|
- Compress Images
|
||||||
- submodules
|
- submodules
|
||||||
|
- Check for new posts
|
||||||
|
|
||||||
- name: Build Image
|
- name: Build Image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
Loading…
Reference in New Issue
Block a user