Publish Registry Content #1014
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
# | |
# Copyright (c) 2020-2021 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: Publish Registry Content | |
on: | |
workflow_run: | |
workflows: ["Next Build/Publish"] | |
types: | |
- completed | |
jobs: | |
publish: | |
name: publish | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Clone source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: extract content | |
run: | | |
docker create --name pluginRegistry quay.io/eclipse/che-plugin-registry:next sh | |
mkdir content | |
docker cp pluginRegistry:/var/www/html/v3 content/v3 | |
docker rm -f pluginRegistry | |
cp content/v3/plugins/index.json content/index.json | |
- name: Publish to surge | |
env: | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | |
run: | | |
sudo apt-get install tree | |
npm install -g surge | |
# generate tree index on all directories | |
for directory in `find content/ -type d` | |
do | |
(cd $directory && tree -H '.' -L 1 --noreport --charset utf-8 | sed '/<p class="VERSION">/,/<\/p>/d' > index.html) | |
done | |
# Make devfile.yaml as index | |
for file in $(find content -name 'devfile.yaml' -type f) | |
do | |
PARENT_DIR=$(dirname $file); | |
cp ${PARENT_DIR}/devfile.yaml ${PARENT_DIR}/index.html | |
done | |
export DEPLOY_DOMAIN=https://che-plugin-registry.surge.sh | |
echo "DEPLOY_DOMAIN=$DEPLOY_DOMAIN" >> $GITHUB_ENV | |
surge ./content --domain $DEPLOY_DOMAIN | |
- name: Publish to gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.CHE_BOT_GITHUB_TOKEN }} | |
VERSION_DIR: main | |
run: | | |
export BUILD_DIR="$PWD/content" | |
export GH_PAGES_DIR="$PWD/gh-pages" | |
./build/dev/publish-plugin-registry-to-gh-pages.sh |