-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (84 loc) · 2.74 KB
/
build.yaml
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
name: Build
on:
pull_request:
branches:
- master
- release-*
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/VERSION'
push:
branches:
- master
- release-*
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/VERSION'
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
GO_VERSION: ''
GOSEC_VERSION: '2.18.2'
HELM_VERSION: v3.13.3
SUBMARINER_VERSION: '0.16.2'
jobs:
build-alb:
name: Build alb
runs-on: ubuntu-22.04
steps:
- uses: jlumbroso/[email protected]
with:
android: true
dotnet: true
haskell: true
docker-images: false
large-packages: false
tool-cache: false
swap-storage: false
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: azure/setup-helm@v3
with:
version: '${{ env.HELM_VERSION }}'
- name: version
uses: HardNorth/[email protected]
with:
version-source: file
version-file: .github/VERSION
version-file-extraction-pattern: 'v(.+)'
- name: build
run: |
source ./scripts/alb-dev-actions.sh
export RELEASE_TAG="v$CURRENT_VERSION-${GITHUB_HEAD_REF}.$(date +%s)"
OPENRESTY_BASE=theseedoaa/alb-nginx-base:v1.22.0
GO_BUILD_BASE=golang:1.18.10-alpine3.16
RUN_BASE=alpine:3.17.6
# build images
docker buildx build --platform linux/amd64 -t alauda/alb:$RELEASE_TAG --build-arg VERSION=$RELEASE_TAG --build-arg RUN_BASE=$RUN_BASE --build-arg BUILD_BASE=$GO_BUILD_BASE -o type=docker -f ./Dockerfile .
docker pull $OPENRESTY_BASE
docker buildx build --platform linux/amd64 -t alauda/alb-nginx:$RELEASE_TAG --build-arg VERSION=$RELEASE_TAG --build-arg OPENRESTY_BASE=$OPENRESTY_BASE --build-arg BUILD_BASE=$GO_BUILD_BASE -o type=docker -f ./template/Dockerfile ./
docker images
docker save alauda/alb:$RELEASE_TAG > alb.tar
docker save alauda/alb-nginx:$RELEASE_TAG > alb-nginx.tar
ls
env
# build chart
alb-build-github-chart alauda/alb:$RELEASE_TAG alauda/alb-nginx:$RELEASE_TAG $RELEASE_TAG ./deploy/chart/alb ./alauda-alb2.tgz
- name: Upload alb images to artifact
uses: actions/upload-artifact@v3
with:
name: alb
path: alb.tar
- name: Upload alb-nginx images to artifact
uses: actions/upload-artifact@v3
with:
name: alb-nginx
path: alb-nginx.tar
- name: Upload chart's to artifact
uses: actions/upload-artifact@v3
with:
name: alb-chart
path: alauda-alb2.tgz