Skip to content

Commit 2c60753

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 2c60753

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/docker.yml

Lines changed: 19 additions & 1 deletion
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,11 @@ defaults:
1317
env:
1418
DOCKER_ORG: lightninglabs
1519
DOCKER_REPO: lightning-terminal
20+
NIGHTLY_DOCKER_REPO: lightning-terminal-nightly
21+
# TODO(guggero): Change the branch to 'master' once the experimental branch is
22+
# merged into master.
23+
NIGHTLY_BRANCH_NAME: 0-19-staging
24+
NIGHTLY_TAG_NAME: experimental-daily-testing
1625

1726
jobs:
1827
main:
@@ -37,6 +46,15 @@ jobs:
3746
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3847
echo "IMAGE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3948
49+
# The daily/nightly build (or manual trigger) will always use the
50+
# experimental branch and push to a different docker repo.
51+
- name: Set daily tag
52+
if: ${{ github.event.schedule == '0 0 * * *' || github.event_name == 'workflow_dispatch' }}
53+
run: |
54+
echo "RELEASE_VERSION=${{env.NIGHTLY_BRANCH_NAME}}" >> $GITHUB_ENV
55+
echo "DOCKER_REPO=${{env.NIGHTLY_DOCKER_REPO}}" >> $GITHUB_ENV
56+
echo "IMAGE_TAG=${{env.NIGHTLY_TAG_NAME}}-$(date -u +%Y%m%d)" >> $GITHUB_ENV
57+
4058
- name: Build and push default image
4159
id: docker_build
4260
uses: lightninglabs/gh-actions/build-push-action@2021.01.25.00

0 commit comments

Comments
 (0)