Skip to content

Update devfile schema based on devfile/api@c088cf36a78ddadb8a45b951a2… #74

Update devfile schema based on devfile/api@c088cf36a78ddadb8a45b951a2…

Update devfile schema based on devfile/api@c088cf36a78ddadb8a45b951a2… #74

# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Next Dockerimage
on:
push:
branches: [main]
repository_dispatch:
types: [build]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
registry-viewer-build:
name: Registry Viewer Build
runs-on: ubuntu-latest
steps:
- name: Check out devfile web source code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Login to Quay
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build the registry viewer image
run: bash ./scripts/build_viewer.sh
- name: Push the registry viewer image
run: bash ./scripts/push.sh registry-viewer:latest quay.io/devfile/registry-viewer:next
dispatch:
needs: registry-viewer-build
strategy:
matrix:
repo: ['devfile/registry']
runs-on: ubuntu-latest
steps:
- name: Get the repository name and commit sha
id: get_commit_info
run: |
# Check if repository name is not set in the client payload
# If it's not set, the triggered commit came from this repo (devfile-web)
# If it is set, the triggered commit came from another source
if [ -z ${{ github.event.client_payload.repo }} ];
then
echo ::set-output name=repo::$(echo ${{ github.event.repository.name }})
else
echo ::set-output name=repo::$(echo ${{ github.event.client_payload.repo }})
fi
# Check if commit sha is not set in the client payload
# If it's not set, the triggered commit came from this repo (devfile-web)
# If it is set, the triggered commit came from another source
if [ -z ${{ github.event.client_payload.sha }} ];
then
echo ::set-output name=sha::$(echo ${{ github.sha }})
else
echo ::set-output name=sha::$(echo ${{ github.event.client_payload.sha }})
fi
- name: Repository dispatch
uses: peter-evans/repository-dispatch@26b39ed245ab8f31526069329e112ab2fb224588 # v2.1.1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: ${{ matrix.repo }}
event-type: build
client-payload: '{"repo": "${{ steps.get_commit_info.outputs.REPO }}", "sha": "${{ steps.get_commit_info.outputs.SHA }}"}'