Repository navigation
81 lines (79 loc) · 2.69 KB
/
Copy pathbuild.yml
File metadata and controls
81 lines (79 loc) · 2.69 KB
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
name: Build
on:
push:
branches: [main, dev]
tags: ['*']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
# Before building the protocol, the required protobuf plugins need to be installed.
- name: Npm Install Protocol
uses: bahmutov/npm-install@v1.6.0
with:
working-directory: 'protocol'
# The protocol is build before other java packages, as they depend on the website.
- name: Build with Gradle
run: ./gradlew :protocol:generateProto :protocol:generateJavascriptPackage
# The website has to be build after the buildJavascriptPackage task has been run.
- name: Npm Install Website
run: npm install --legacy-peer-deps
working-directory: website
# Builds the actual website for production
- name: Build Website
run: CI='' npm run build-all
working-directory: website
# Builds the backend (will include the websites generated code in the apps classpath)
- name: Build Server
run: ./gradlew build copyDependencies
# Login to Docker Registry
- name: Docker Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build the image and push it to the registry
- name: Create Server Docker Meta
id: docker_server_meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: ehenoma/jsheets
tags: |
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }}
type=ref,event=tag
flavor: |
latest=false
- name: Build Server
uses: docker/build-push-action@v2
with:
context: .
file: server/deploy/Dockerfile
push: true
tags: ${{ steps.docker_server_meta.outputs.tags }}
labels: ${{ steps.docker_server_meta.outputs.labels }}
- name: Create Runtime Docker Meta
id: docker_runtime_meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: ehenoma/jsheets-runtime
tags: |
type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'main') }}
type=ref,event=tag
flavor: |
latest=false
- name: Build Runtime
uses: docker/build-push-action@v2
with:
context: .
file: runtime/deploy/Dockerfile
push: true
tags: ${{ steps.docker_runtime_meta.outputs.tags }}
labels: ${{ steps.docker_runtime_meta.outputs.labels }}