-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.75 KB
/
deploy-api-oc4.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
name: Deploy API to Openshift 4 Registry
on:
push:
branches: [main]
paths:
- "src/backend/**"
- ".github/workflows/deploy-api-oc4.yml"
workflow_dispatch: {}
jobs:
git_sha:
uses: SierraSystems/reusable-workflows/.github/workflows/get-github-commitversion.yml@main
with:
working_directory: "."
build:
needs:
- git_sha
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to the Openshift Cluster
run: |
oc login --token=${{ secrets.OPENSHIFT4_SA_PASSWORD }} --server=${{ secrets.OPENSHIFT4_EXTERNAL_REPOSITORY }}
- name: Login to Openshift Docker
run : |
docker login ${{ secrets.OPENSHIFT4_EXTERNAL_REPOSITORY }} -u ${{ secrets.OPENSHIFT4_SA_USERNAME }} -p ${{ secrets.OPENSHIFT4_SA_PASSWORD }}
- name: Build the Docker image
env:
MVN_PROFILE: ai-reviewer,splunk
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
run: |
docker-compose build ai-reviewer-api
docker tag jag-ai-reviewer_ai-reviewer-api ${{ secrets.OPENSHIFT4_EXTERNAL_REPOSITORY }}/${{ secrets.OPENSHIFT4_TOOLS_NAMESPACE }}/ai-reviewer-api:latest
docker push ${{ secrets.OPENSHIFT4_EXTERNAL_REPOSITORY }}/${{ secrets.OPENSHIFT4_TOOLS_NAMESPACE }}/ai-reviewer-api:latest
docker tag jag-ai-reviewer_ai-reviewer-api ${{ secrets.OPENSHIFT4_EXTERNAL_REPOSITORY }}/${{ secrets.OPENSHIFT4_TOOLS_NAMESPACE }}/ai-reviewer-api:${{ needs.git_sha.outputs.github-release-version }}
docker push ${{ secrets.OPENSHIFT4_EXTERNAL_REPOSITORY }}/${{ secrets.OPENSHIFT4_TOOLS_NAMESPACE }}/ai-reviewer-api:${{ needs.git_sha.outputs.github-release-version }}