-
Notifications
You must be signed in to change notification settings - Fork 150
64 lines (61 loc) · 2.08 KB
/
publish-content-push-main.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
#
# 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@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '16'
- 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 meta.yaml as index
for file in $(find content -name 'meta.yaml' -type f)
do
PARENT_DIR=$(dirname $file);
cp ${PARENT_DIR}/meta.yaml ${PARENT_DIR}/index.html
done
export DEPLOY_DOMAIN=https://che-plugin-registry-main.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