1+ #
2+ # Copyright (C) 2022-2023 Red Hat, Inc. (https://github.com/Commonjava/gateway)
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+ #
16+
17+ # This workflow will build a Java project with Maven
18+ # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
19+
20+ name : Merge / Push Build
21+
22+ on :
23+ push :
24+ branches :
25+ - ' master'
26+
27+ jobs :
28+ publish-snapshot :
29+ name : Build & push image
30+
31+ runs-on : ubuntu-latest
32+
33+ permissions :
34+ contents : read
35+ packages : write
36+
37+ env :
38+ MAVEN_OPTS : " -Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m"
39+
40+ steps :
41+ - uses : actions/checkout@v6
42+
43+ - name : Set up JDK
44+ uses : actions/setup-java@v5
45+ with :
46+ distribution : ' temurin'
47+ architecture : x64
48+ java-version : 17
49+
50+ - name : maven-settings-xml-action
51+ uses : whelk-io/maven-settings-xml-action@v22
52+ with :
53+ repositories : ' [{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
54+
55+ - name : " Maven Verify"
56+ if : ${{ github.event.repository.fork == true }}
57+ run : mvn -B -e verify
58+
59+ - name : " Maven Build"
60+ if : ${{ github.event.repository.fork == false }}
61+ run : mvn -B -e clean install
62+
63+ - name : Checkout tools repo
64+ uses : actions/checkout@v6
65+ with :
66+ repository : Commonjava/commonjava-images
67+ path : commonjava-images
68+
69+ - name : Locate artifacts
70+ id : locate-artifacts
71+ run : |
72+ tarball=$(ls -d $PWD/target/*-runner.jar)
73+ cp "$tarball" "commonjava-images/indy-repository-service/indy-repository-service-runner.jar"
74+
75+ - name : Log in to Quay.io
76+ uses : redhat-actions/podman-login@v1
77+ with :
78+ username : ${{ secrets.QUAY_USERNAME }}
79+ password : ${{ secrets.QUAY_ROBOT_TOKEN }}
80+ registry : quay.io
81+
82+ - name : Buildah build
83+ id : buildah-build
84+ uses : redhat-actions/buildah-build@v2
85+ with :
86+ image : indy-repository-service
87+ tags : ${{ github.ref_name }}
88+ platforms : linux/amd64
89+ containerfiles : |
90+ commonjava-images/indy-repository-service/actions.Dockerfile
91+ context : commonjava-images/indy-repository-service/
92+
93+ - name : Push To quay.io
94+ id : push-to-quay
95+ uses : redhat-actions/push-to-registry@v2
96+ with :
97+ image : ${{ steps.buildah-build.outputs.image }}
98+ tags : ${{ steps.buildah-build.outputs.tags }}
99+ registry : quay.io/factory2
0 commit comments