-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (132 loc) · 6.53 KB
/
build.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
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
name: build
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
jobs:
image:
permissions:
actions: read
contents: read
id-token: write
security-events: write
runs-on: ubuntu-latest
strategy:
matrix:
exclude:
- from: focal
release: zed
- from: focal
release: "2023.1"
- from: focal
release: "2023.2"
- from: jammy
release: wallaby
- from: jammy
release: xena
from:
- focal
- jammy
release:
- wallaby
- xena
- yoga
- zed
- "2023.1"
- "2023.2"
steps:
- name: Install QEMU static binaries
uses: docker/setup-qemu-action@v2
- name: Configure Buildkit
uses: docker/setup-buildx-action@v2
- name: Checkout project
uses: actions/checkout@v3
- name: Setup environment variables
run: echo PROJECT_REF=$(cat manifest.yml | yq '."${{ matrix.release }}".sha') >> $GITHUB_ENV
- name: Authenticate with Quay.io
uses: docker/login-action@v2
if: ${{ github.event_name == 'push' }}
with:
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
- name: Install cosign
uses: sigstore/cosign-installer@main
- name: Verify images
run: |-
cosign verify --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/vexxhost/docker-openstack-builder/.github/workflows/build.yml@refs/heads/main quay.io/vexxhost/openstack-builder-${{ matrix.from }}:b30eefa3016d4d18ad81a25526617859576fe172
cosign verify --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/vexxhost/docker-openstack-runtime/.github/workflows/build.yml@refs/heads/main quay.io/vexxhost/openstack-runtime-${{ matrix.from }}:f2098f520d8f5c191c271ebdb6e20e761d8ce0be
- name: Build image
uses: docker/build-push-action@v3
with:
build-args: |-
BUILDER_IMAGE=quay.io/vexxhost/openstack-builder-${{ matrix.from }}:b30eefa3016d4d18ad81a25526617859576fe172
RUNTIME_IMAGE=quay.io/vexxhost/openstack-runtime-${{ matrix.from }}:f2098f520d8f5c191c271ebdb6e20e761d8ce0be
RELEASE=${{ matrix.release }}
PROJECT=horizon
PROJECT_REPO=https://github.com/vexxhost/horizon
PROJECT_REF=${{ env.PROJECT_REF }}
EXTRAS=
PROFILES=apache
DIST_PACKAGES=
PIP_PACKAGES=cryptography python-binary-memcached git+https://github.com/openstack/designate-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/heat-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/ironic-ui.git@stable/${{ matrix.release }} git+https://github.com/vexxhost/magnum-ui.git@stable/${{ matrix.release }} git+https://github.com/openstack/neutron-vpnaas-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/octavia-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/senlin-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/monasca-ui.git@stable/${{ matrix.release }} git+https://github.com/openstack/manila-ui.git@stable/${{ matrix.release }}
cache-from: type=gha,scope=${{ matrix.from }}-${{ matrix.release }}
cache-to: type=gha,mode=max,scope=${{ matrix.from }}-${{ matrix.release }}
context: .
load: "true"
tags: quay.io/vexxhost/horizon:${{ env.PROJECT_REF }}-${{ matrix.from }}-${{ github.sha }}
env:
DOCKER_CONTENT_TRUST: "1"
- name: Scan image for vulnerabilities
uses: aquasecurity/trivy-action@master
with:
format: sarif
ignore-unfixed: "true"
image-ref: quay.io/vexxhost/horizon:${{ env.PROJECT_REF }}-${{ matrix.from }}-${{ github.sha }}
output: trivy-results.sarif
- name: Upload scan result
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
category: ${{ env.PROJECT_REF }}-${{ matrix.from }}
sarif_file: trivy-results.sarif
- name: Build image
uses: docker/build-push-action@v3
with:
build-args: |-
BUILDER_IMAGE=quay.io/vexxhost/openstack-builder-${{ matrix.from }}:b30eefa3016d4d18ad81a25526617859576fe172
RUNTIME_IMAGE=quay.io/vexxhost/openstack-runtime-${{ matrix.from }}:f2098f520d8f5c191c271ebdb6e20e761d8ce0be
RELEASE=${{ matrix.release }}
PROJECT=horizon
PROJECT_REPO=https://github.com/vexxhost/horizon
PROJECT_REF=${{ env.PROJECT_REF }}
EXTRAS=
PROFILES=apache
DIST_PACKAGES=
PIP_PACKAGES=cryptography python-binary-memcached git+https://github.com/openstack/designate-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/heat-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/ironic-ui.git@stable/${{ matrix.release }} git+https://github.com/vexxhost/magnum-ui.git@stable/${{ matrix.release }} git+https://github.com/openstack/neutron-vpnaas-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/octavia-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/senlin-dashboard.git@stable/${{ matrix.release }} git+https://github.com/openstack/monasca-ui.git@stable/${{ matrix.release }} git+https://github.com/openstack/manila-ui.git@stable/${{ matrix.release }}
cache-from: type=gha,scope=${{ matrix.from }}-${{ matrix.release }}
cache-to: type=gha,mode=max,scope=${{ matrix.from }}-${{ matrix.release }}
context: .
platforms: linux/amd64
push: ${{ github.event_name == 'push' }}
sbom: "true"
tags: quay.io/vexxhost/horizon:${{ env.PROJECT_REF }}-${{ matrix.from }}-${{ github.sha }}
env:
DOCKER_CONTENT_TRUST: "1"
- name: Promote image
uses: akhilerm/[email protected]
if: github.event_name == 'push' && ((matrix.from == 'focal') || (matrix.from == 'jammy' && matrix.release != 'yoga'))
with:
dst: quay.io/vexxhost/horizon:${{ matrix.release }}
src: quay.io/vexxhost/horizon:${{ env.PROJECT_REF }}-${{ matrix.from }}-${{ github.sha }}
- name: Sign the container image
run: cosign sign --yes quay.io/vexxhost/horizon@${{ steps.push-step.outputs.digest }}
if: ${{ github.event_name == 'push' }}