-
Notifications
You must be signed in to change notification settings - Fork 31
83 lines (77 loc) · 2.53 KB
/
push-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
name: CI build and push
concurrency:
group: pr-${{ github.event.number }}
cancel-in-progress: false
on:
push:
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+
tags:
jobs:
code-analysis:
uses: ./.github/workflows/ci-code-analysis.yml
if: github.repository_owner == 'cryostatio'
with:
checkout-repo: ${{ github.event.pull_request.head.repo.full_name }}
checkout-ref: ${{ github.event.pull_request.head.ref }}
build-and-test-amd64:
uses: ./.github/workflows/ci-build-image.yml
permissions:
pull-requests: write
if: github.repository_owner == 'cryostatio'
with:
build-arch: amd64
build-and-test-arm64:
uses: ./.github/workflows/ci-build-image.yml
permissions:
pull-requests: write
if: github.repository_owner == 'cryostatio'
with:
build-arch: arm64
push-to-quay:
runs-on: ubuntu-latest
needs: [code-analysis, build-and-test-amd64, build-and-test-arm64]
env:
CRYOSTAT_IMG: quay.io/cryostat/cryostat
permissions:
packages: write
steps:
- uses: actions/download-artifact@v3
with:
name: cryostat-amd64
- name: Load cryostat-amd64 image
env:
IMAGE_VERSION: ${{ needs.build-and-test-amd64.outputs.image-version }}
run: |
podman load -i cryostat-amd64.tar
podman tag $CRYOSTAT_IMG:$IMAGE_VERSION-linux-amd64
- uses: actions/download-artifact@v3
with:
name: cryostat-arm64
- name: Load cryostat-arm64 image
env:
IMAGE_VERSION: ${{ needs.build-and-test-arm64.outputs.image-version }}
run: |
podman load -i cryostat-arm64.tar
podman tag $CRYOSTAT_IMG:$IMAGE_VERSION-linux-arm64
- name: Create OCI Manifest
id: create-manifest
env:
IMAGE_VERSION: ${{ needs.build-and-test-amd64.outputs.image-version }}
run: |
podman manifest create $CRYOSTAT_IMG:$IMAGE_VERSION containers-storage:$CRYOSTAT_IMG:$IMAGE_VERSION-linux-amd64 containers-storage:$CRYOSTAT_IMG:$IMAGE_VERSION-linux-arm64
echo "tags=$IMAGE_VERSION" >> "$GITHUB_OUTPUT"
- name: Push to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: cryostat
tags: ${{ steps.create-manifest.outputs.tags }}
registry: quay.io/cryostat
username: cryostat+bot
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"