-
Notifications
You must be signed in to change notification settings - Fork 150
57 lines (54 loc) · 1.63 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
55
56
57
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@v4
with:
node-version: 18.x
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Install Yarn
run: |
corepack enable
corepack prepare yarn@stable --activate
- uses: actions/checkout@v4
- 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: 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'
- name: Save PR number to file
if: github.event_name == 'pull_request'
run: echo ${{ github.event.number }} > PR_NUMBER.txt
- name: Archive PR number
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: PR_NUMBER
path: PR_NUMBER.txt