Skip to content

Commit aa4c9c3

Browse files
build nightly docker images (#25317) (#25333)
Backport #25317 by @techknowlogick followup of #25308 this time to build & push nightly docker images Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1 parent 4e79c76 commit aa4c9c3

File tree

2 files changed

+30
-306
lines changed

2 files changed

+30
-306
lines changed

.drone.yml

-304
Original file line numberDiff line numberDiff line change
@@ -244,133 +244,6 @@ steps:
244244
exclude:
245245
- pull_request
246246

247-
---
248-
kind: pipeline
249-
type: docker
250-
name: docker-linux-amd64-release
251-
252-
platform:
253-
os: linux
254-
arch: amd64
255-
256-
trigger:
257-
ref:
258-
- refs/heads/main
259-
260-
steps:
261-
- name: fetch-tags
262-
image: docker:git
263-
pull: always
264-
commands:
265-
- git fetch --tags --force
266-
267-
- name: publish
268-
image: plugins/docker:latest
269-
pull: always
270-
settings:
271-
auto_tag: false
272-
tags: nightly-linux-amd64
273-
repo: gitea/gitea
274-
build_args:
275-
- GOPROXY=https://goproxy.io
276-
password:
277-
from_secret: docker_password
278-
username:
279-
from_secret: docker_username
280-
environment:
281-
PLUGIN_MIRROR:
282-
from_secret: plugin_mirror
283-
DOCKER_BUILDKIT: 1
284-
when:
285-
event:
286-
exclude:
287-
- pull_request
288-
289-
- name: publish-rootless
290-
image: plugins/docker:latest
291-
settings:
292-
dockerfile: Dockerfile.rootless
293-
auto_tag: false
294-
tags: nightly-linux-amd64-rootless
295-
repo: gitea/gitea
296-
build_args:
297-
- GOPROXY=https://goproxy.io
298-
password:
299-
from_secret: docker_password
300-
username:
301-
from_secret: docker_username
302-
environment:
303-
PLUGIN_MIRROR:
304-
from_secret: plugin_mirror
305-
DOCKER_BUILDKIT: 1
306-
when:
307-
event:
308-
exclude:
309-
- pull_request
310-
311-
---
312-
kind: pipeline
313-
name: docker-linux-amd64-release-branch
314-
315-
platform:
316-
os: linux
317-
arch: amd64
318-
319-
trigger:
320-
ref:
321-
- "refs/heads/release/v*"
322-
323-
steps:
324-
- name: fetch-tags
325-
image: docker:git
326-
pull: always
327-
commands:
328-
- git fetch --tags --force
329-
330-
- name: publish
331-
image: plugins/docker:latest
332-
pull: always
333-
settings:
334-
auto_tag: false
335-
tags: ${DRONE_BRANCH##release/v}-nightly-linux-amd64
336-
repo: gitea/gitea
337-
build_args:
338-
- GOPROXY=https://goproxy.io
339-
password:
340-
from_secret: docker_password
341-
username:
342-
from_secret: docker_username
343-
environment:
344-
PLUGIN_MIRROR:
345-
from_secret: plugin_mirror
346-
DOCKER_BUILDKIT: 1
347-
when:
348-
event:
349-
exclude:
350-
- pull_request
351-
352-
- name: publish-rootless
353-
image: plugins/docker:latest
354-
settings:
355-
dockerfile: Dockerfile.rootless
356-
auto_tag: false
357-
tags: ${DRONE_BRANCH##release/v}-nightly-linux-amd64-rootless
358-
repo: gitea/gitea
359-
build_args:
360-
- GOPROXY=https://goproxy.io
361-
password:
362-
from_secret: docker_password
363-
username:
364-
from_secret: docker_username
365-
environment:
366-
PLUGIN_MIRROR:
367-
from_secret: plugin_mirror
368-
DOCKER_BUILDKIT: 1
369-
when:
370-
event:
371-
exclude:
372-
- pull_request
373-
374247
---
375248
kind: pipeline
376249
type: docker
@@ -506,136 +379,6 @@ steps:
506379
exclude:
507380
- pull_request
508381

509-
---
510-
kind: pipeline
511-
type: docker
512-
name: docker-linux-arm64-release
513-
514-
platform:
515-
os: linux
516-
arch: arm64
517-
518-
trigger:
519-
ref:
520-
- refs/heads/main
521-
paths:
522-
exclude:
523-
- "docs/**"
524-
525-
steps:
526-
- name: fetch-tags
527-
image: docker:git
528-
pull: always
529-
commands:
530-
- git fetch --tags --force
531-
532-
- name: publish
533-
image: plugins/docker:latest
534-
pull: always
535-
settings:
536-
auto_tag: false
537-
tags: nightly-linux-arm64
538-
repo: gitea/gitea
539-
build_args:
540-
- GOPROXY=https://goproxy.io
541-
password:
542-
from_secret: docker_password
543-
username:
544-
from_secret: docker_username
545-
environment:
546-
PLUGIN_MIRROR:
547-
from_secret: plugin_mirror
548-
DOCKER_BUILDKIT: 1
549-
when:
550-
event:
551-
exclude:
552-
- pull_request
553-
554-
- name: publish-rootless
555-
image: plugins/docker:latest
556-
settings:
557-
dockerfile: Dockerfile.rootless
558-
auto_tag: false
559-
tags: nightly-linux-arm64-rootless
560-
repo: gitea/gitea
561-
build_args:
562-
- GOPROXY=https://goproxy.io
563-
password:
564-
from_secret: docker_password
565-
username:
566-
from_secret: docker_username
567-
environment:
568-
PLUGIN_MIRROR:
569-
from_secret: plugin_mirror
570-
DOCKER_BUILDKIT: 1
571-
when:
572-
event:
573-
exclude:
574-
- pull_request
575-
576-
---
577-
kind: pipeline
578-
name: docker-linux-arm64-release-branch
579-
580-
platform:
581-
os: linux
582-
arch: arm64
583-
584-
trigger:
585-
ref:
586-
- "refs/heads/release/v*"
587-
588-
steps:
589-
- name: fetch-tags
590-
image: docker:git
591-
pull: always
592-
commands:
593-
- git fetch --tags --force
594-
595-
- name: publish
596-
image: plugins/docker:latest
597-
pull: always
598-
settings:
599-
auto_tag: false
600-
tags: ${DRONE_BRANCH##release/v}-nightly-linux-arm64
601-
repo: gitea/gitea
602-
build_args:
603-
- GOPROXY=https://goproxy.io
604-
password:
605-
from_secret: docker_password
606-
username:
607-
from_secret: docker_username
608-
environment:
609-
PLUGIN_MIRROR:
610-
from_secret: plugin_mirror
611-
DOCKER_BUILDKIT: 1
612-
when:
613-
event:
614-
exclude:
615-
- pull_request
616-
617-
- name: publish-rootless
618-
image: plugins/docker:latest
619-
settings:
620-
dockerfile: Dockerfile.rootless
621-
auto_tag: false
622-
tags: ${DRONE_BRANCH##release/v}-nightly-linux-arm64-rootless
623-
repo: gitea/gitea
624-
build_args:
625-
- GOPROXY=https://goproxy.io
626-
password:
627-
from_secret: docker_password
628-
username:
629-
from_secret: docker_username
630-
environment:
631-
PLUGIN_MIRROR:
632-
from_secret: plugin_mirror
633-
DOCKER_BUILDKIT: 1
634-
when:
635-
event:
636-
exclude:
637-
- pull_request
638-
639382
---
640383
kind: pipeline
641384
type: docker
@@ -681,50 +424,3 @@ depends_on:
681424
- docker-linux-amd64-release-candidate-version
682425
- docker-linux-arm64-release-version
683426
- docker-linux-arm64-release-candidate-version
684-
685-
---
686-
kind: pipeline
687-
type: docker
688-
name: docker-manifest
689-
690-
platform:
691-
os: linux
692-
arch: amd64
693-
694-
steps:
695-
- name: manifest-rootless
696-
image: plugins/manifest
697-
pull: always
698-
settings:
699-
auto_tag: false
700-
ignore_missing: true
701-
spec: docker/manifest.rootless.tmpl
702-
password:
703-
from_secret: docker_password
704-
username:
705-
from_secret: docker_username
706-
707-
- name: manifest
708-
image: plugins/manifest
709-
settings:
710-
auto_tag: false
711-
ignore_missing: true
712-
spec: docker/manifest.tmpl
713-
password:
714-
from_secret: docker_password
715-
username:
716-
from_secret: docker_username
717-
718-
trigger:
719-
ref:
720-
- refs/heads/main
721-
- "refs/heads/release/v*"
722-
paths:
723-
exclude:
724-
- "docs/**"
725-
726-
depends_on:
727-
- docker-linux-amd64-release
728-
- docker-linux-arm64-release
729-
- docker-linux-amd64-release-branch
730-
- docker-linux-arm64-release-branch

.github/workflows/release-nightly.yml

+30-2
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,33 @@ jobs:
5555
runs-on: ubuntu-latest
5656
steps:
5757
- uses: actions/checkout@v3
58-
- uses: docker/setup-buildx-action@v1
59-
# build for linux/amd64, and linux/arm64 (possibly include linux/arm/v7 later. not included now because it adds significant amount to the build time)
58+
- uses: docker/setup-qemu-action@v2
59+
- uses: docker/setup-buildx-action@v2
60+
- name: Get cleaned branch name
61+
id: clean_name
62+
run: |
63+
# if main then say nightly otherwise cleanup name
64+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
65+
echo "branch=nightly" >> "$GITHUB_OUTPUT"
66+
exit 0
67+
fi
68+
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
69+
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
70+
- name: Login to Docker Hub
71+
uses: docker/login-action@v2
72+
with:
73+
username: ${{ secrets.DOCKERHUB_USERNAME }}
74+
password: ${{ secrets.DOCKERHUB_TOKEN }}
75+
- name: build rootful docker image
76+
uses: docker/build-push-action@v4
77+
with:
78+
platforms: linux/amd64,linux/arm64
79+
push: true
80+
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
81+
- name: build rootless docker image
82+
uses: docker/build-push-action@v4
83+
with:
84+
platforms: linux/amd64,linux/arm64
85+
push: true
86+
file: Dockerfile.rootless
87+
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless

0 commit comments

Comments
 (0)