-
Notifications
You must be signed in to change notification settings - Fork 10
46 lines (44 loc) · 1.53 KB
/
ci-cd.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
name: Build Container
on:
push:
branches:
- main
jobs:
build:
if: github.repository == 'rht-labs/lodestar-backend'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13.0.1
- name: Find and Replace Reader Writer
shell: bash
env:
READER: ${{ secrets.READERS }}
WRITER: ${{ secrets.WRITERS }}
run: |
sed -i '/^quarkus.http.auth.policy.role-reader.roles-allowed/ s/$/,'"$READER"'/' src/main/resources/application.properties
sed -i '/^quarkus.http.auth.policy.role-writer.roles-allowed/ s/$/,'"$WRITER"'/' src/main/resources/application.properties
- name: SonarCloud Static Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }} -q
- name: Clean sonar
run: mvn clean
- name: Find and Replace Commit
uses: jacobtomlinson/[email protected]
with:
find: "###GIT_COMMIT###"
replace: "${{ github.sha }}"
include: ".s2i"
- uses: redhat-cop/github-actions/s2i@v2
with:
base: registry.access.redhat.com/ubi8/openjdk-11:1.3
output_image: "quay.io/rht-labs/lodestar-backend:${{ github.sha }}"
image_push_registry: quay.io
image_push_username: ${{ secrets.QUAY_USERNAME }}
image_push_password: ${{ secrets.QUAY_PASSWORD }}
image_tags: main