summary refs log tree commit diff
path: root/.github/workflows
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-11-29 12:22:08 +0000
committerGitHub <noreply@github.com>2022-11-29 12:22:08 +0000
commit5b0dcda7f048ac50ceb0324842ac1eb69e3165f1 (patch)
tree8bab9f05cbd412f5f39d6315d55885d78b9e5bb9 /.github/workflows
parentPOC delete stale non-e2e devices for users (#14038) (diff)
downloadsynapse-5b0dcda7f048ac50ceb0324842ac1eb69e3165f1.tar.xz
Fix GHA job for pushing the complement-synapse image (#14573)
Co-authored-by: Michael Kaye <1917473+michaelkaye@users.noreply.github.com>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/push_complement_image.yml20
1 files changed, 13 insertions, 7 deletions
diff --git a/.github/workflows/push_complement_image.yml b/.github/workflows/push_complement_image.yml
index 937bbcbad0..f26143de6b 100644
--- a/.github/workflows/push_complement_image.yml
+++ b/.github/workflows/push_complement_image.yml
@@ -34,17 +34,17 @@ jobs:
     steps:
       - name: Checkout specific branch (debug build)
         uses: actions/checkout@v3
-        if: 'github.event.type == "workflow_dispatch"'
+        if: github.event_name == 'workflow_dispatch'
         with:
           ref: ${{ inputs.branch }}
       - name: Checkout clean copy of develop (scheduled build)
         uses: actions/checkout@v3
-        if: 'github.event.type == "schedule"'
+        if: github.event_name == 'schedule'
         with:
           ref: develop
       - name: Checkout clean copy of master (on-push)
         uses: actions/checkout@v3
-        if: 'github.event.type == "push"'
+        if: github.event_name == 'push'
         with:
           ref: master
       - name: Login to registry
@@ -55,14 +55,20 @@ jobs:
           password: ${{ secrets.GITHUB_TOKEN }}
       - name: Work out labels for complement image
         id: meta
-        uses: docker/metadata-action@v1
+        uses: docker/metadata-action@v4
         with:
           images: ghcr.io/${{ github.repository }}/complement-synapse
-      - name: Build complement image
+          tags: |
+            type=schedule,pattern=nightly,enable=${{ github.event_name == 'schedule'}}
+            type=raw,value=develop,enable=${{ github.event_name == 'schedule' || inputs.branch == 'develop' }}
+            type=raw,value=latest,enable=${{ github.event_name == 'push' || inputs.branch == 'master' }}
+            type=sha,format=long
+      - name: Run scripts-dev/complement.sh to generate complement-synapse:latest image.
         run: scripts-dev/complement.sh --build-only
       - name: Tag and push generated image
         run: |
-          for TAG in ${{ steps.meta.outputs.tags }}; do 
-            docker tag complement-synapse:latest $TAG
+          for TAG in ${{ join(fromJson(steps.meta.outputs.json).tags, ' ') }}; do 
+            echo "tag and push $TAG"
+            docker tag complement-synapse $TAG
             docker push $TAG
           done