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:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 9 * * *'
|
- cron: '0 1 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -32,13 +32,13 @@ jobs:
|
|||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check for New Commits (Nightly Only)
|
- name: Check for new commits (nightly only)
|
||||||
id: check
|
id: check
|
||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
run: |
|
run: |
|
||||||
# 3AM CET
|
# 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)
|
count=$(git rev-list --count --since="$since" --until=now HEAD)
|
||||||
if [ "$count" -gt 0 ]; then
|
if [ "$count" -gt 0 ]; then
|
||||||
echo "new_commits=true" >> $GITHUB_OUTPUT
|
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:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
schedule:
|
||||||
|
- cron: '0 1 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-image:
|
build-and-push-image:
|
||||||
@@ -17,10 +19,29 @@ 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: |
|
||||||
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 "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
||||||
echo "git_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
echo "git_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@@ -50,7 +71,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
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
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
|
|||||||
Reference in New Issue
Block a user