forked from redhat-developer/devspaces
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (93 loc) · 3.06 KB
/
plugin-registry-pr-check-build.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
# Copyright (c) 2020-2022 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: Plugin Registry - PR check - Build
on:
push:
paths:
- 'dependencies/che-plugin-registry/**'
pull_request:
paths:
- 'dependencies/che-plugin-registry/**'
jobs:
image-build:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: dependencies/che-plugin-registry
steps:
- name: Clone source code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
name: Cache yarn dependencies
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
name: Cache vsix dependencies
id: download-unpacked-cache
with:
path: |
/tmp/che-plugin-registry/download-folder
/tmp/che-plugin-registry/unpack-folder
key: download-unpacked-cache-${{ hashFiles('**/che-theia-plugins.yaml') }}
restore-keys: |
download-unpacked-cache-
- name: Login to Quay.io
uses: azure/docker-login@v1
with:
login-server: quay.io
username: ${{ secrets.DS_QUAY_USERNAME }}
password: ${{ secrets.DS_QUAY_PASSWORD }}
- name: image-build
run: |
export SKIP_FORMAT=true
export SKIP_LINT=true
export SKIP_TEST=true
BUILDER=docker ./build.sh --tag pr-check --offline
EXPORTED_FOLDER=/var/www/html/v3
ls -la output/
docker run --rm --entrypoint=sh quay.io/devspaces/pluginregistry-rhel8:pr-check -c "ls -la ${EXPORTED_FOLDER}"
docker create --name pluginRegistry quay.io/devspaces/pluginregistry-rhel8:pr-check sh
mkdir root-dir
docker cp pluginRegistry:${EXPORTED_FOLDER} root-dir/v3
docker rm -f pluginRegistry
cp root-dir/v3/plugins/index.json root-dir/index.json
tar zcvf content-devspaces.tgz -C root-dir .
- uses: actions/upload-artifact@v2
with:
name: plugin-registry-content-devspaces
path: dependencies/che-plugin-registry/content-devspaces.tgz
pull-request-info:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-20.04
needs: [image-build]
steps:
- name: Store PR info
run: |
echo "${{ github.event.number }}" > PR_NUMBER
echo "${{ github.event.pull_request.head.sha }}" > PR_SHA
- uses: actions/upload-artifact@v2
with:
name: pull-request-number
path: PR_NUMBER
- uses: actions/upload-artifact@v2
with:
name: pull-request-sha
path: PR_SHA