-
Notifications
You must be signed in to change notification settings - Fork 152
54 lines (51 loc) · 1.57 KB
/
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
SERVER_TAG: ghcr.io/eclipse/openvsx-server
WEBUI_TAG: ghcr.io/eclipse/openvsx-webui
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Install Yarn
run: |
corepack enable
corepack prepare yarn@stable --activate
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Sonar needs blame info
- name: Set Image Version
run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
- name: Build CLI
run: yarn --cwd cli
- name: Build Web UI Image
run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui
- name: Run Server Tests
run: server/gradlew --no-daemon -p server check
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build Server Image
run: docker build -t $SERVER_TAG:$IMAGE_VERSION server
- name: Push Docker Images
run: |
echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push $SERVER_TAG:$IMAGE_VERSION
docker push $WEBUI_TAG:$IMAGE_VERSION
if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master'