forked from AzBuilder/terrakube
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (81 loc) · 3.4 KB
/
release.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Push Docker Images
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Update POM Version
run: mvn versions:set-property -Dproperty=revision -DnewVersion=$VERSION -DgenerateBackupPoms=false
- name: Build Image with Maven
run: mvn -pl "api,registry,executor" spring-boot:build-image -B --file pom.xml
env:
USER_NAME: ${{ secrets.USER_NAME }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
cache-dependency-path: ui/package.json
- run: yarn install --frozen-lockfile
working-directory: ./ui
- run: npm run build --if-present
working-directory: ./ui
env:
CI: false
- name: docker build ui
working-directory: ./ui
run: |
docker build -t terrakube-ui:latest .
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Add Git to Executor
run: docker run --user="root" --entrypoint launcher $(docker images executor -q) "apt-get update && apt-get install git jq curl -y"
- name: Restore default user and entrypoint
run: docker commit --change='ENTRYPOINT ["/cnb/process/web"]' --change='USER cnb' $(docker ps -lq) executortemp
- name: Docker tag API Image
run: docker tag $(docker images api-server -q) azbuilder/api-server:$VERSION
- name: Docker tag API Image latest
run: docker tag $(docker images api-server -q) azbuilder/api-server:latest
- name: Docker Push API latest
run: docker push azbuilder/api-server:$VERSION
- name: Docker Push API latest
run: docker push azbuilder/api-server:latest
- name: Docker tag Registry Image
run: docker tag $(docker images open-registry -q) azbuilder/open-registry:$VERSION
- name: Docker tag Registry Image latest
run: docker tag $(docker images open-registry -q) azbuilder/open-registry:latest
- name: Docker Push Registry
run: docker push azbuilder/open-registry:$VERSION
- name: Docker Push Registry latest
run: docker push azbuilder/open-registry:latest
- name: Docker tag EXECUTOR Image
run: docker tag $(docker images executortemp -q) azbuilder/executor:$VERSION
- name: Docker tag EXECUTOR Image latest
run: docker tag $(docker images executortemp -q) azbuilder/executor:latest
- name: Docker Push EXECUTOR latest
run: docker push azbuilder/executor:$VERSION
- name: Docker Push EXECUTOR latest
run: docker push azbuilder/executor:latest
- name: Docker tag UI Image
run: docker tag $(docker images terrakube-ui -q) azbuilder/terrakube-ui:$VERSION
- name: Docker tag UI Image latest
run: docker tag $(docker images terrakube-ui -q) azbuilder/terrakube-ui:latest
- name: Docker Push UI Version
run: docker push azbuilder/terrakube-ui:$VERSION
- name: Docker Push UI Latest
run: docker push azbuilder/terrakube-ui:latest