This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a GitHub action based release job (#309)
* Add a GitHub action based release job Part of eclipse-che/che#18072 Signed-off-by: Eric Williams <ericwill@redhat.com> * Add dockerhub login step Signed-off-by: Eric Williams <ericwill@redhat.com> * Update file and job name Signed-off-by: Eric Williams <ericwill@redhat.com>
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# Copyright (c) 2020 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
|
||
name: Release Che Devfile Registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- release | ||
paths: | ||
- VERSION | ||
|
||
jobs: | ||
release-build-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone source code | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
ref: release | ||
|
||
- name: Login to Quay.io | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Login to Docker Hub | ||
uses: azure/docker-login@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push patched base images and happy path image | ||
run: | | ||
export TAG=$(head -n 1 VERSION) | ||
/bin/bash arbitrary-users-patch/happy-path/build_happy_path_image.sh --push | ||
/bin/bash arbitrary-users-patch/build_images.sh --push | ||
- name: Build and push images | ||
run: | | ||
SHORT_SHA1=$(git rev-parse --short HEAD) | ||
VERSION=$(head -n 1 VERSION) | ||
IMAGE=che-devfile-registry | ||
DOCKERFILE_PATH=./build/dockerfiles/Dockerfile | ||
docker build -t ${IMAGE} -f ${DOCKERFILE_PATH} --build-arg PATCHED_IMAGES_TAG=${VERSION} --target registry . | ||
docker tag ${IMAGE} quay.io/eclipse/${IMAGE}:${SHORT_SHA1} | ||
docker push quay.io/eclipse/${IMAGE}:${SHORT_SHA1} | ||
docker tag ${IMAGE} quay.io/eclipse/${IMAGE}:${VERSION} | ||
docker push quay.io/eclipse/${IMAGE}:${VERSION} |