-
Notifications
You must be signed in to change notification settings - Fork 28
131 lines (110 loc) · 3.58 KB
/
deploy-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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: 🚀 Build and Deploy main
on:
push:
branches:
- main
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'deploy-main'
cancel-in-progress: true
jobs:
build-distribution:
runs-on: ubuntu-latest
steps:
- name: '🛰️ Checkout source code'
uses: actions/checkout@v4
- name: '🛰️ Setup Node'
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@kaoto'
cache: 'yarn'
- name: '🛰️ Setup Java'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: '🔧 Install dependencies'
run: yarn
# Build packages excluding @kaoto/camel-catalog since it was build during installing dependencies
- name: '🔧 Build packages'
run: |
yarn workspaces foreach --verbose --all --topological-dev --exclude @kaoto/camel-catalog run build
- name: '🔧 Tar UI Dist'
shell: bash
run: |
tar -czf ${{ runner.temp }}/kaoto-ui.tgz -C packages/ui/dist .
ls -lh ${{ runner.temp }}/kaoto-ui.tgz
- name: '🔧 Persist UI Dist'
uses: actions/upload-artifact@v4
with:
name: 'kaoto-ui-${{ github.run_id }}'
path: '${{ runner.temp }}/kaoto-ui.tgz'
retention-days: 1
deploy-pages:
runs-on: ubuntu-latest
needs:
- build-distribution
steps:
- name: '🛰️ Checkout source code'
uses: actions/checkout@v4
- name: '🛰️ Setup Pages'
uses: actions/configure-pages@v5
- name: '🛰️ Download UI Dist'
uses: actions/download-artifact@v4
with:
name: kaoto-ui-${{ github.run_id }}
path: '${{ runner.temp }}'
- name: '🛰️ Extract UI Dist'
shell: bash
run: |
mkdir -p packages/ui/dist
tar -xzf "${{ runner.temp }}/kaoto-ui.tgz" -C packages/ui/dist
- name: '📤 Upload artifact @kaoto/kaoto web application'
uses: actions/upload-pages-artifact@v3
with:
path: 'packages/ui/dist'
- name: '🚀 Deploy to GitHub Pages'
id: deployment
uses: actions/deploy-pages@v4
deploy-images:
if: github.repository == 'KaotoIO/kaoto'
runs-on: ubuntu-latest
needs:
- build-distribution
steps:
- name: '🛰️ Checkout source code'
uses: actions/checkout@v4
- name: '🛰️ Download UI Dist'
uses: actions/download-artifact@v4
with:
name: kaoto-ui-${{ github.run_id }}
path: '${{ runner.temp }}'
- name: '🛰️ Extract UI Dist'
shell: bash
run: |
mkdir -p packages/ui/dist
tar -xzf "${{ runner.temp }}/kaoto-ui.tgz" -C packages/ui/dist
- name: '🛰️ Login to Container Registry'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: '🔧 Build Container Image'
shell: bash
# TODO: the container image name should be configurable via vars/secrets
run: |
docker build -t "quay.io/kaotoio/kaoto-app:main" .
- name: '📤 Upload Container Image'
shell: bash
run: |
docker push quay.io/kaotoio/kaoto-app:main