forked from kubeflow/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (72 loc) · 3.59 KB
/
tag-release-quay.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Image push per Github Tag
# This GitHub action activates whenever a new tag is created on the repo under opendatahub-io org
# and creates a copy of the image of the associated commit hash with the
# appropriate tag name.
run-name: Creating new tag in quay based on pushed tag in Github.
on:
workflow_dispatch:
inputs:
target_tag:
default: 'vx.y.z'
description: 'DSP Tag'
required: true
env:
IMAGE_SERVER: quay.io/opendatahub/ds-pipelines-api-server
IMAGE_UI: quay.io/opendatahub/ds-pipelines-frontend
IMAGE_PA: quay.io/opendatahub/ds-pipelines-persistenceagent
IMAGE_SWF: quay.io/opendatahub/ds-pipelines-scheduledworkflow
IMAGE_MLMD_ENVOY: quay.io/opendatahub/ds-pipelines-metadata-envoy
IMAGE_MLMD_GRPC: quay.io/opendatahub/ds-pipelines-metadata-grpc
IMAGE_LAUNCHER: quay.io/opendatahub/ds-pipelines-launcher
IMAGE_DRIVER: quay.io/opendatahub/ds-pipelines-driver
jobs:
copy-tag-to-quay:
runs-on: ubuntu-latest
if: github.repository == 'opendatahub-io/data-science-pipelines'
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Install skopeo
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install skopeo
- name: Login to quay.io
shell: bash
env:
QUAY_ROBOT_USERNAME: ${{ secrets.QUAY_ROBOT_USERNAME }}
QUAY_ROBOT_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
run: |
skopeo login quay.io -u ${QUAY_ROBOT_USERNAME} -p ${QUAY_ROBOT_TOKEN}
- name: Get latest tag hash
id: hash
run: echo "hash=$(git rev-parse --short=7 ${{ inputs.target_tag }} )" >> ${GITHUB_OUTPUT}
- name: Create new tag
shell: bash
env:
TAG: ${{ inputs.target_tag }}
HASH: ${{ steps.hash.outputs.hash }}
run: |
skopeo copy docker://${IMAGE_SERVER}:main-${{ env.HASH }} docker://${IMAGE_SERVER}:${{ env.TAG }}
skopeo copy docker://${IMAGE_UI}:main-${{ env.HASH }} docker://${IMAGE_UI}:${{ env.TAG }}
skopeo copy docker://${IMAGE_PA}:main-${{ env.HASH }} docker://${IMAGE_PA}:${{ env.TAG }}
skopeo copy docker://${IMAGE_SWF}:main-${{ env.HASH }} docker://${IMAGE_SWF}:${{ env.TAG }}
skopeo copy docker://${IMAGE_MLMD_ENVOY}:main-${{ env.HASH }} docker://${IMAGE_MLMD_ENVOY}:${{ env.TAG }}
skopeo copy docker://${IMAGE_MLMD_GRPC}:main-${{ env.HASH }} docker://${IMAGE_MLMD_GRPC}:${{ env.TAG }}
skopeo copy docker://${IMAGE_LAUNCHER}:main-${{ env.HASH }} docker://${IMAGE_LAUNCHER}:${{ env.TAG }}
skopeo copy docker://${IMAGE_DRIVER}:main-${{ env.HASH }} docker://${IMAGE_DRIVER}:${{ env.TAG }}
- name: Create latest tag
shell: bash
env:
HASH: ${{ steps.hash.outputs.hash }}
run: |
skopeo copy docker://${IMAGE_SERVER}:main-${{ env.HASH }} docker://${IMAGE_SERVER}:latest
skopeo copy docker://${IMAGE_UI}:main-${{ env.HASH }} docker://${IMAGE_UI}:latest
skopeo copy docker://${IMAGE_PA}:main-${{ env.HASH }} docker://${IMAGE_PA}:latest
skopeo copy docker://${IMAGE_SWF}:main-${{ env.HASH }} docker://${IMAGE_SWF}:latest
skopeo copy docker://${IMAGE_MLMD_ENVOY}:main-${{ env.HASH }} docker://${IMAGE_MLMD_ENVOY}:latest
skopeo copy docker://${IMAGE_MLMD_GRPC}:main-${{ env.HASH }} docker://${IMAGE_MLMD_GRPC}:latest
skopeo copy docker://${IMAGE_LAUNCHER}:main-${{ env.HASH }} docker://${IMAGE_LAUNCHER}:latest
skopeo copy docker://${IMAGE_DRIVER}:main-${{ env.HASH }} docker://${IMAGE_DRIVER}:latest