forked from kedacore/http-add-on
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (118 loc) · 5.1 KB
/
build_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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Publish official image to GitHub Container Registry
on:
push:
tags: [ "v[0-9].[0-9].[0-9]" ]
env:
IMAGE_OPERATOR_NAME: ghcr.io/${{ github.repository_owner }}/http-add-on-operator
IMAGE_INTERCEPTOR_NAME: ghcr.io/${{ github.repository_owner }}/http-add-on-interceptor
IMAGE_SCALER_NAME: ghcr.io/${{ github.repository_owner }}/http-add-on-scaler
jobs:
build_operator:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up tags and refs
id: prep
run: |
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Get the version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: ${{ github.repository_owner }}
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.GITHUB_TOKEN }}
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ghcr.io
- name: Build and push operator image
uses: docker/build-push-action@v2
with:
# Docker repository to tag the image with
tags: ${{ env.IMAGE_OPERATOR_NAME }}:latest,${{ env.IMAGE_OPERATOR_NAME }}:${{ steps.get_version.outputs.VERSION }}
labels: |
sh.keda.http.image.source=${{github.event.repository.html_url}}
sh.keda.http.image.created=${{steps.prep.outputs.created}}
sh.keda.http.image.revision=${{github.sha}}
sh.keda.http.image.release=${{github.ref}}
build-args: "VERSION=${{ steps.prep.outputs.VERSION }}"
file: operator/Dockerfile
context: .
push: true
build_interceptor:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up tags and refs
id: prep
run: |
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Get the version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: ${{ github.repository_owner }}
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.GITHUB_TOKEN }}
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ghcr.io
- name: Build and push interceptor image
uses: docker/build-push-action@v2
with:
# Docker repository to tag the image with
tags: ${{ env.IMAGE_INTERCEPTOR_NAME }}:latest,${{ env.IMAGE_INTERCEPTOR_NAME }}:${{ steps.get_version.outputs.VERSION }}
labels: |
sh.keda.http.image.source=${{github.event.repository.html_url}}
sh.keda.http.image.created=${{steps.prep.outputs.created}}
sh.keda.http.image.revision=${{github.sha}}
sh.keda.http.image.release=${{github.ref}}
file: interceptor/Dockerfile
context: .
push: true
build_scaler:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up tags and refs
id: prep
run: |
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Get the version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: ${{ github.repository_owner }}
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.GITHUB_TOKEN }}
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ghcr.io
- name: Build and push scaler image
uses: docker/build-push-action@v2
with:
# Docker repository to tag the image with
tags: ${{ env.IMAGE_SCALER_NAME }}:latest,${{ env.IMAGE_SCALER_NAME }}:${{ steps.get_version.outputs.VERSION }}
labels: |
sh.keda.http.image.source=${{github.event.repository.html_url}}
sh.keda.http.image.created=${{steps.prep.outputs.created}}
sh.keda.http.image.revision=${{github.sha}}
sh.keda.http.image.release=${{github.ref}}
file: scaler/Dockerfile
context: .
push: true