1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+ #
18+
19+ name : Build OpenServerless Admin Api
20+
21+ on :
22+ push :
23+ tags :
24+ - ' [0-9]*'
25+ branches-ignore :
26+ - ' *'
27+ jobs :
28+ image :
29+ name : Build OpenServerless Admin Api
30+ runs-on : ubuntu-latest
31+ steps :
32+ - name : Remove unnecessary files
33+ run : |
34+ sudo rm -rf /usr/share/dotnet
35+ sudo rm -rf "$AGENT_TOOLSDIRECTORY"
36+ - name : Checkout
37+ uses : actions/checkout@v2
38+ with :
39+ submodules : recursive
40+ - name : Setup
41+ run : bash .github/cisetup.sh
42+ - name : License
43+ uses : apache/skywalking-eyes@main
44+ - name : Assign TAG from pull request
45+ if : ${{ github.event_name == 'pull_request' }}
46+ run : |
47+ echo "IMG_TAG=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
48+ - name : Assign TAG from push
49+ if : ${{ github.event_name != 'pull_request' }}
50+ run : |
51+ echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
52+ - name : Unit Test
53+ run : task test
54+ continue-on-error : false
55+ - name : Registry login
56+ uses : docker/login-action@v3
57+ with :
58+ registry : registry.hub.docker.com
59+ username : ${{ secrets.DOCKERHUB_USER }}
60+ password : ${{ secrets.DOCKERHUB_TOKEN }}
61+ - name : Set up QEMU
62+ uses : docker/setup-qemu-action@v3
63+ with :
64+ image : tonistiigi/binfmt:qemu-v7.0.0-28
65+ - name : Set up Docker Buildx
66+ uses : docker/setup-buildx-action@v3
67+ - name : Image
68+ env :
69+ REGISTRY : apache
70+ NAMESPACE : apache
71+ run : task buildx PUSH=1 TAG=$IMG_TAG
0 commit comments