Skip to content

Commit 76254d3

Browse files
committed
ci: add weekly schedule; push on schedule; avoid duplicate no-push build on schedule
1 parent f57a521 commit 76254d3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- '**/README.md'
1010
tags:
1111
- '*'
12+
schedule:
13+
- cron: '0 3 * * 1'
1214
workflow_dispatch:
1315
inputs:
1416
push:
@@ -70,20 +72,20 @@ jobs:
7072
curl -fL "https://raw.githubusercontent.com/b4b4r07/httpstat/master/httpstat.sh" -o _dl/httpstat.sh
7173
7274
- name: Login to Docker Hub
73-
if: inputs.push == true || github.event_name == 'push'
75+
if: inputs.push == true || github.event_name == 'push' || github.event_name == 'schedule'
7476
uses: docker/login-action@v2
7577
with:
7678
username: ${{ secrets.DOCKERHUB_USERNAME }}
7779
password: ${{ secrets.DOCKERHUB_TOKEN }}
7880

7981
- name: Set up QEMU
80-
if: inputs.push == true || github.event_name == 'push'
82+
if: inputs.push == true || github.event_name == 'push' || github.event_name == 'schedule'
8183
uses: docker/setup-qemu-action@v3
8284
with:
8385
platforms: linux/amd64
8486

8587
- name: Set up Docker Buildx
86-
if: inputs.push == true || github.event_name == 'push'
88+
if: inputs.push == true || github.event_name == 'push' || github.event_name == 'schedule'
8789
uses: docker/setup-buildx-action@v2
8890

8991
- name: Build (no push) via docker build (act)
@@ -93,7 +95,7 @@ jobs:
9395
-t curl-edge:${IMAGE_TAG} -t curl-edge:latest .
9496
9597
- name: Build (no push)
96-
if: inputs.push != true && github.event_name != 'push' && env.ACT != 'true'
98+
if: inputs.push != true && github.event_name != 'push' && github.event_name != 'schedule' && env.ACT != 'true'
9799
uses: docker/build-push-action@v4
98100
with:
99101
context: .
@@ -123,7 +125,7 @@ jobs:
123125
/opt/httpstat.sh -I --http3 https://cloudflare-quic.com/ || true
124126
125127
- name: Build and push
126-
if: inputs.push == true || github.event_name == 'push'
128+
if: inputs.push == true || github.event_name == 'push' || github.event_name == 'schedule'
127129
uses: docker/build-push-action@v4
128130
with:
129131
context: .

0 commit comments

Comments
 (0)