This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
146 lines (126 loc) · 4.74 KB
/
verify.yaml
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
144
145
146
name: Build & Verify
on:
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'CODE_OF_CONDUCT*'
- 'CONTRIBUTING.md'
- 'dco.txt'
branches: [main]
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'CODE_OF_CONDUCT*'
- 'CONTRIBUTING.md'
- 'dco.txt'
branches: [main]
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PLATFORMS: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
IMAGE_ORG: apicurio
IMAGE_TAG: latest-snapshot
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-latest
if: github.repository_owner == 'apicurio'
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v3
# Set up the JDK
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
# Set up node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: 'ui/**/package-lock.json'
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
if: github.event_name == 'push'
id: buildx
uses: docker/setup-buildx-action@v1
- name: Inspect builder
if: github.event_name == 'push'
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build Apicurio API Designer back-end
run: mvn install -Dmaven.javadoc.skip=true --no-transfer-progress -DtrimStackTrace=false
- name: Build Apicurio API Designer front-end
run: |
cd ui
npm install
npm run lint
npm run build
npm run package
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Login to DockerHub Registry
if: github.event_name == 'push'
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build and Publish Docker Image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
context: ./dist/docker/target/docker
file: ./dist/docker/target/docker/Dockerfile.jvm
platforms: ${{env.PLATFORMS}}
push: true
tags: |
docker.io/${{env.IMAGE_ORG}}/apicurio-api-designer:${{env.IMAGE_TAG}}
quay.io/${{env.IMAGE_ORG}}/apicurio-api-designer:${{env.IMAGE_TAG}}
- name: Build and Publish Docker Image (UI)
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
context: ./ui
file: ./ui/Dockerfile
platforms: ${{env.PLATFORMS}}
push: true
tags: |
docker.io/${{env.IMAGE_ORG}}/apicurio-api-designer-ui:${{env.IMAGE_TAG}}
quay.io/${{env.IMAGE_ORG}}/apicurio-api-designer-ui:${{env.IMAGE_TAG}}
- name: Google Chat Notification (Always)
if: github.event_name == 'push' && always()
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
with:
name: ${{ github.job }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}
- name: Google Chat Notification (Error)
if: github.event_name == 'push' && failure()
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
with:
name: ${{ github.job }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_ERRORS }}
status: ${{ job.status }}
# Trigger a deployment workflow in the apicurio-operate-first repository, which will
# deploy the `latest-snapshot` version of designer into the 3scale OpenShift cluster
# that we just built and pushed in the steps above.
trigger-3scale-deploy:
needs: [build-test]
if: github.event_name == 'push'
uses: apicurio/apicurio-3scale-gitops/.github/workflows/deploy_latest_designer.yml@main
secrets: inherit