Skip to content

Commit b02f8da

Browse files
nehhenguggero
authored andcommitted
GitHub: add nightly schedule to Docker CD workflow
Added a daily schedule to the Docker workflow to automate builds and pushes of the `daily-testing` image. This change introduces a new cron job that runs every day at midnight (UTC) and triggers the workflow.
1 parent 85a89b5 commit b02f8da

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/docker.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ on:
44
push:
55
tags:
66
- 'v*'
7-
7+
schedule:
8+
# Every day at midnight (UTC).
9+
- cron: '0 0 * * *'
10+
# Manual trigger through the UI for testing.
11+
workflow_dispatch:
812

913
defaults:
1014
run:
@@ -13,6 +17,9 @@ defaults:
1317
env:
1418
DOCKER_ORG: lightninglabs
1519
DOCKER_REPO: lightning-terminal
20+
NIGHTLY_DOCKER_REPO: lightning-terminal-nightly
21+
NIGHTLY_BRANCH_NAME: 0-19-staging
22+
NIGHTLY_TAG_NAME: experimental-daily-testing
1623

1724
jobs:
1825
main:
@@ -37,6 +44,15 @@ jobs:
3744
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3845
echo "IMAGE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3946
47+
# The daily/nightly build (or manual trigger) will always use the
48+
# experimental branch and push to a different docker repo.
49+
- name: Set daily tag
50+
if: ${{ github.event.schedule == '0 0 * * *' || github.event_name == 'workflow_dispatch' }}
51+
run: |
52+
echo "RELEASE_VERSION=${{env.NIGHTLY_BRANCH_NAME}}" >> $GITHUB_ENV
53+
echo "DOCKER_REPO=${{env.NIGHTLY_DOCKER_REPO}}" >> $GITHUB_ENV
54+
echo "IMAGE_TAG=${{env.NIGHTLY_TAG_NAME}}-$(date -u +%Y%m%d)" >> $GITHUB_ENV
55+
4056
- name: Build and push default image
4157
id: docker_build
4258
uses: lightninglabs/gh-actions/[email protected]

0 commit comments

Comments
 (0)