diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 613eccd69..0486c0b92 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -77,3 +77,4 @@ jobs: image_push_registry: quay.io image_push_username: ${{ secrets.QUAY_USERNAME }} image_push_password: ${{ secrets.QUAY_PASSWORD }} + image_tags: master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..c2c7775a0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Add Tags to Release + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: get the release version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: tag with release version + uses: tinact/docker.image-retag@1.0.2 + with: + image_name: rht-labs/omp-frontend + image_old_tag: ${{ github.sha }} + image_new_tag: ${{ steps.get_version.outputs.VERSION }} + registry: quay.io + registry_username: ${{ secrets.QUAY_USERNAME }} + registry_password: ${{ secrets.QUAY_PASSWORD }} + - name: tag with latest + uses: tinact/docker.image-retag@1.0.2 + with: + image_name: rht-labs/omp-frontend + image_old_tag: ${{ github.sha }} + registry: quay.io + registry_username: ${{ secrets.QUAY_USERNAME }} + registry_password: ${{ secrets.QUAY_PASSWORD }} \ No newline at end of file diff --git a/deployment/templates/deploymentconfig.yaml b/deployment/templates/deploymentconfig.yaml index 20cb4a730..1401d802e 100644 --- a/deployment/templates/deploymentconfig.yaml +++ b/deployment/templates/deploymentconfig.yaml @@ -26,11 +26,7 @@ spec: deploymentconfig: {{ .Values.name }} spec: containers: - {{- if eq .Values.imageTag "latest" }} - image: {{ .Values.name }}:{{ .Values.imageTag }} - {{- else }} - - image: {{ .Values.imageName }}:{{ .Values.imageTag }} - {{- end }} imagePullPolicy: Always name: {{ .Values.name }} ports: @@ -57,7 +53,6 @@ spec: name: frontend-config triggers: - type: ConfigChange - {{- if eq .Values.imageTag "latest" }} - type: ImageChange imageChangeParams: automatic: true @@ -66,4 +61,3 @@ spec: name: {{ .Values.name }}:{{ .Values.imageTag }} containerNames: - {{ .Values.name }} - {{- end }} diff --git a/deployment/templates/imagestream.yaml b/deployment/templates/imagestream.yaml index a9f9b2db8..3c51c5fef 100644 --- a/deployment/templates/imagestream.yaml +++ b/deployment/templates/imagestream.yaml @@ -1,4 +1,3 @@ -{{- if eq .Values.imageTag "latest" }} --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -21,4 +20,3 @@ spec: referencePolicy: type: Source {{- end}} -{{- end }}