Skip to content

Commit 524f4bb

Browse files
Merge pull request #7315 from bgridley-stacks/add-pox-wf-integration-docker-schedule
Add 10pm ET scheduled Docker build for pox-wf-integration branch
2 parents a3ae354 + 2280779 commit 524f4bb

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/scheduled-docker-image.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ name: Docker Image
55
on:
66
workflow_dispatch:
77
schedule:
8-
- cron: "00 05 * * *" # 0500 UTC daily
8+
- cron: "00 05 * * *" # 0500 UTC daily (nightly develop build)
9+
- cron: "00 02 * * *" # 0200 UTC daily == 10pm ET (EDT) (pox-wf-integration build)
910

1011
# Set default permissions
1112
permissions:
@@ -56,13 +57,19 @@ jobs:
5657
branch: ${{ steps.set-vars.outputs.branch }}
5758
steps:
5859
# Set local env vars.
59-
# - If the event is a schedule, use develop branch; otherwise use ref_name
60+
# - For a manual run, use the selected ref_name
61+
# - For the 0500 UTC schedule, use develop (nightly)
62+
# - For the 0200 UTC schedule (10pm ET), use pox-wf-integration
6063
- name: Set Local Vars
6164
id: set-vars
6265
run: |
6366
var_branch="${{ github.ref_name }}"
6467
if [ "${{ github.event_name }}" == "schedule" ]; then
65-
var_branch="develop"
68+
if [ "${{ github.event.schedule }}" == "00 02 * * *" ]; then
69+
var_branch="pox-wf-integration"
70+
else
71+
var_branch="develop"
72+
fi
6673
fi
6774
echo "branch=${var_branch}" >> "$GITHUB_OUTPUT"
6875
@@ -133,8 +140,13 @@ jobs:
133140
var_annotation_pattern="${{ needs.build-binaries.outputs.branch }}" # default to use the branch name
134141
var_default_image="${{ env.DOCKER_REGISTRY }}/${{ github.repository }}"
135142
if [ "${{ github.event_name }}" == "schedule" ]; then
136-
var_default_image="${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/stacks-nightly"
137-
var_annotation_pattern="Nightly" # for scheduled (nightly) builds, use 'Nightly'
143+
if [ "${{ github.event.schedule }}" == "00 02 * * *" ]; then
144+
# 10pm ET pox-wf-integration build: publish to the default image, tagged by branch name
145+
var_annotation_pattern="pox-wf-integration"
146+
else
147+
var_default_image="${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/stacks-nightly"
148+
var_annotation_pattern="Nightly" # for scheduled (nightly) builds, use 'Nightly'
149+
fi
138150
fi
139151
{
140152
echo "docker_images=${var_default_image}"
@@ -185,8 +197,10 @@ jobs:
185197
tags: |
186198
# if trigger is workflow_dispatch
187199
type=ref,event=branch,enable=${{ github.event_name == 'workflow_dispatch' }}
188-
# if trigger is schedule, use a timestamp
189-
type=schedule,pattern={{date 'YYYYMMDD'}}
200+
# if trigger is the nightly (0500 UTC) schedule, use a timestamp
201+
type=schedule,pattern={{date 'YYYYMMDD'}},enable=${{ github.event.schedule == '00 05 * * *' }}
202+
# if trigger is the 10pm ET (0200 UTC) schedule, tag with the branch name
203+
type=raw,value=pox-wf-integration,enable=${{ github.event.schedule == '00 02 * * *' }}
190204
191205
# Build and push the docker image(s)
192206
- name: Build and Push

0 commit comments

Comments
 (0)