Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2dad42a

Browse files
michaelkayeDMRobertsonDavid Robertson
authored
Push complement image to a docker registry (#14509)
* GHA workflow to build complement images of key branches. * Add changelog.d * GHA workflow to build complement images of key branches. * Add changelog.d * Update complement.yml Remove special casing for michaelk branch. * Update complement.yml Should run on master, develop not main, develop * Rename file to be more obvious * Merge did not go correctly. * Setup 5am builds of develop, limit to one run at once. * Fix crontab---run once at 5AM, not very minute between 5 and 6 * Fix cron syntax again? * Tweak workflow name * Allow manual debug runs * Tweak indentation Ctrl-Alt-L in PyCharm Co-authored-by: David Robertson <[email protected]> Co-authored-by: David Robertson <[email protected]>
1 parent 58383c1 commit 2dad42a

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This task does not run complement tests, see tests.yaml instead.
2+
# This task does not build docker images for synapse for use on docker hub, see docker.yaml instead
3+
4+
name: Store complement-synapse image in ghcr.io
5+
on:
6+
push:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: '0 5 * * *'
10+
workflow_dispatch:
11+
inputs:
12+
branch:
13+
required: true
14+
default: 'develop'
15+
type: choice
16+
options:
17+
- develop
18+
- master
19+
20+
# Only run this action once per pull request/branch; restart if a new commit arrives.
21+
# C.f. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
22+
# and https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
build:
29+
name: Build and push complement image
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
packages: write
34+
steps:
35+
- name: Checkout specific branch (debug build)
36+
uses: actions/checkout@v3
37+
if: 'github.event.type == "workflow_dispatch"'
38+
with:
39+
ref: ${{ inputs.branch }}
40+
- name: Checkout clean copy of develop (scheduled build)
41+
uses: actions/checkout@v3
42+
if: 'github.event.type == "schedule"'
43+
with:
44+
ref: develop
45+
- name: Checkout clean copy of master (on-push)
46+
uses: actions/checkout@v3
47+
if: 'github.event.type == "push"'
48+
with:
49+
ref: master
50+
- name: Login to registry
51+
uses: docker/login-action@v1
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Work out labels for complement image
57+
id: meta
58+
uses: docker/metadata-action@v1
59+
with:
60+
images: ghcr.io/${{ github.repository }}/complement-synapse
61+
- name: Build complement image
62+
run: scripts-dev/complement.sh --build-only
63+
- name: Tag and push generated image
64+
run: |
65+
for TAG in ${{ steps.meta.outputs.tags }}; do
66+
docker tag complement-synapse:latest $TAG
67+
docker push $TAG
68+
done

changelog.d/14509.docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Push complement-synapse docker images to ghcr.io repository.

0 commit comments

Comments
 (0)