-
Notifications
You must be signed in to change notification settings - Fork 63
102 lines (84 loc) · 3.85 KB
/
ci.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
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
name: CI
env:
IMAGE_NAME: activemq-artemis-operator
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.19.8'
cache: true
- name: Checkout the repo
uses: actions/checkout@v2
- name: Start minikube
id: minikube
uses: medyagh/setup-minikube@master
with:
cpus: 2
memory: 4g
- name: Check generate files
run: make generate-deploy && make bundle && git status && git diff-index --quiet HEAD --
- name: Build the image
run: |
podman build --build-arg TARGETOS=linux --build-arg TARGETARCH=amd64 --label quay.expires-after=90d --label git-sha=$GITHUB_SHA --no-cache --platform linux/amd64 --manifest $IMAGE_NAME:dev.latest .
- name: Push the image into minikube
run: |
export SHELL=/bin/bash
eval $(minikube -p minikube docker-env)
docker image list
export OPERATOR_IMAGE=$(grep -Po '(?<=image: ).*' ./deploy/operator.yaml)
podman tag $IMAGE_NAME:dev.latest $OPERATOR_IMAGE
podman save --output activemq-artemis-operator-image.tar --format docker-archive $OPERATOR_IMAGE
docker image load --input activemq-artemis-operator-image.tar
docker image list
- name: Execute the tests
run: make test-mk-do-fast-v
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Checkout artemiscloud.github.io
uses: actions/checkout@v3
with:
repository: artemiscloud/artemiscloud.github.io
path: artemiscloud.github.io
- name: Build the docs
run: >
rm -rf artemiscloud.github.io/content/en/docs &&
cp -r docs artemiscloud.github.io/content/en &&
cd artemiscloud.github.io &&
npm install && npm run build
- name: Set up QEMU
if: ${{ github.event_name == 'push' }}
uses: docker/setup-qemu-action@v1
- name: Build the image for arm64
if: ${{ github.event_name == 'push' }}
run: |
podman build --build-arg TARGETOS=linux --build-arg TARGETARCH=arm64 --label quay.expires-after=90d --label git-sha=$GITHUB_SHA --no-cache --platform linux/arm64 --manifest $IMAGE_NAME:dev.latest .
- name: Push the dev image
if: ${{ github.event_name == 'push' }}
run: |
COMMIT_TAG=dev.$(date +%Y%m%d).$(git rev-parse --short "$GITHUB_SHA")
podman login --username=${{ secrets.QUAY_USERNAME }} --password=${{ secrets.QUAY_PASSWORD }} quay.io
podman manifest push $IMAGE_NAME:dev.latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:$COMMIT_TAG
podman manifest push $IMAGE_NAME:dev.latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:dev.latest
- name: Build the bundle image
run: podman build --file bundle.Dockerfile --label quay.expires-after=90d --label git-sha=$GITHUB_SHA --tag $IMAGE_NAME-bundle:dev.latest .
- name: Push the bundle image
if: ${{ github.event_name == 'push' }}
run: |
COMMIT_TAG=dev.$(date +%Y%m%d).$(git rev-parse --short "$GITHUB_SHA")
podman login --username=${{ secrets.QUAY_USERNAME }} --password=${{ secrets.QUAY_PASSWORD }} quay.io
podman tag $IMAGE_NAME-bundle:dev.latest quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:$COMMIT_TAG
podman push quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:$COMMIT_TAG
podman tag $IMAGE_NAME-bundle:dev.latest quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:dev.latest
podman push quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:dev.latest