Add nightly for Docker build
This commit is contained in:
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
tags:
|
||||
- '*'
|
||||
schedule:
|
||||
- cron: '0 9 * * *'
|
||||
- cron: '0 1 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -32,13 +32,13 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check for New Commits (Nightly Only)
|
||||
- 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) 09:00:00"
|
||||
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
|
||||
|
||||
25
.github/workflows/build_docker.yml
vendored
25
.github/workflows/build_docker.yml
vendored
@@ -4,6 +4,8 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
schedule:
|
||||
- cron: '0 1 * * *'
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
@@ -17,10 +19,29 @@ jobs:
|
||||
- name: Check out code
|
||||
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
|
||||
id: buildvars
|
||||
run: |
|
||||
echo "version=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
|
||||
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
|
||||
fi
|
||||
echo "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
||||
echo "git_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -50,7 +71,7 @@ jobs:
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/${{ github.repository }}${{ !contains(github.ref, '-rc.') && '-testing' || '' }}
|
||||
ghcr.io/${{ github.repository }}${{ !contains(github.ref, '-rc') && !contains(github.ref, '-nightly') && '-testing' || '' }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
|
||||
Reference in New Issue
Block a user