Trigger by tag for docker
This commit is contained in:
22
.github/workflows/build_docker.yml
vendored
22
.github/workflows/build_docker.yml
vendored
@@ -3,9 +3,7 @@ name: Build Docker Image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v**'
|
- '*'
|
||||||
schedule:
|
|
||||||
- cron: '40 0 * * *'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-image:
|
build-and-push-image:
|
||||||
@@ -19,27 +17,9 @@ jobs:
|
|||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check for new commits (nightly only)
|
|
||||||
id: check
|
|
||||||
if: github.event_name == 'schedule'
|
|
||||||
continue-on-error: false
|
|
||||||
run: |
|
|
||||||
# 3AM CET
|
|
||||||
since="$(date -d 'yesterday' +%Y-%m-%d) 01:00:00"
|
|
||||||
count=$(git rev-list --count --since="$since" --until=now HEAD)
|
|
||||||
if [ "$count" -gt 0 ]; then
|
|
||||||
echo "new_commits=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "no new commits found for nightly build"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Set version
|
- name: Set version
|
||||||
id: buildvars
|
id: buildvars
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "schedule" ]; then
|
|
||||||
echo "version=$(date +'%Y.%m.%d-nightly')" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "version=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
|
echo "version=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
echo "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
echo "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
||||||
|
|||||||
Reference in New Issue
Block a user