forked from swarmpit/swarmpit
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (79 loc) · 2.25 KB
/
build.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Test, Build & Deploy
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
clojure:
name: Test & Build Clojure
env:
DOCKER: stable
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: install java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: install clojure tools
uses: DeLaGuardo/[email protected]
with:
lein: latest
- run: ./init-db.sh
name: start DB
working-directory: dev/script
- run: ./init-influx.sh
name: start Influx
working-directory: dev/script
- run: ./init-influx.sh
name: start Agent
working-directory: dev/script
- run: ./start-dind.sh
name: start Docker in Docker
working-directory: dev/script
- run: lein deps
#- run: lein test :all
- run: lein uberjar
- name: upload release jar
uses: actions/upload-artifact@v3
with:
name: swarmpit.jar
path: target/swarmpit.jar
docker:
name: Build and push docker
runs-on: ubuntu-latest
needs: clojure
env:
SECRET: ${{ secrets.GITLAB_USERNAME }}
PR: ${{ github.event.pull_request.number }}
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
name: download release jar
with:
name: swarmpit.jar
path: target
- name: set up QEMU
uses: docker/setup-qemu-action@v2
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: login to gitlab
if: env.SECRET != 0
uses: docker/login-action@v2
with:
registry: registry.gitlab.tapentertainment.com
username: ${{ secrets.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_PASSWORD }}
- name: build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: registry.gitlab.tapentertainment.com/common/swarmpit-prebuild:main