Skip to content

Commit 59c6723

Browse files
committed
Merge remote-tracking branch 'upstream/main' into gmt-pinned-versions
* upstream/main: Add nightly CI to trigger deployment Add nightly build config
2 parents 03d2baf + 83593b1 commit 59c6723

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy nightly build
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *' # Run at 2 AM UTC every day
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch: # Manual trigger
10+
11+
jobs:
12+
deploy-nightly:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
# We intentionally don't set `persist-credentials` to `false` because we
17+
# want to push to the nightly branch. This is safe because we only use
18+
# our own commands and there are no external actions beyond this point.
19+
20+
- name: Configure git
21+
run: |
22+
git config user.name "github-actions[bot]"
23+
git config user.email "github-actions[bot]@users.noreply.github.com"
24+
25+
- name: Update heroku.yml
26+
run: |
27+
sed -i 's/NIGHTLY: 0/NIGHTLY: 1/' heroku.yml
28+
29+
- name: Create and push commit to nightly branch
30+
run: |
31+
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
32+
git checkout -B nightly
33+
git add heroku.yml
34+
git commit -m "deploy: $TIMESTAMP"
35+
git push --force origin nightly

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.12-slim
2+
ARG NIGHTLY=0
23

34
# Install packages needed to run your application (not build deps):
45
# We need to recreate the /usr/share/man/man{1..8} directories first because
@@ -34,6 +35,11 @@ RUN set -ex \
3435
zlib1g-dev \
3536
" \
3637
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
38+
&& if [ "$NIGHTLY" = "1" ]; then \
39+
NIGHTLY_URL=$(curl -s https://releases.wagtail.org/nightly/latest.json | \
40+
grep -o 'https://[^"]*') \
41+
&& sed -i "s|wagtail>=.*|${NIGHTLY_URL}|" /requirements/base.txt; \
42+
fi \
3743
&& python3.12 -m venv ${VIRTUAL_ENV} \
3844
&& python3.12 -m pip install -U pip \
3945
&& python3.12 -m pip install --no-cache-dir -r /requirements/production.txt \

heroku.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ build:
22
docker:
33
web:
44
dockerfile: Dockerfile
5+
config:
6+
NIGHTLY: 0
57

68
release:
79
image: web

0 commit comments

Comments
 (0)