-
Notifications
You must be signed in to change notification settings - Fork 21
102 lines (81 loc) · 2.66 KB
/
latest-release.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
name: latest-release
# Build "latest" container, run e2e tests against it, and deploy it to
# https://trustify-latest-staging.apps.cluster.trustification.rocks/
on:
push:
branches:
- main
workflow_dispatch:
concurrency: latest-release
env:
IMAGE_NAME: trustd
IMAGE_TAG: latest
OPENSHIFT_NAMESPACE: trustify-latest
OPENSHIFT_SERVER: https://api.cluster.trustification.rocks:6443
APP_NAME: staging
jobs:
build:
uses: ./.github/workflows/build-binary.yaml
with:
version: latest
publish:
needs: [ build ]
runs-on: ubuntu-22.04
outputs:
image: ${{ steps.push.outputs.registry-path }}
permissions:
contents: write
packages: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/download
- name: Display downloaded content
run: ls -R ${{ github.workspace }}/download
# Build the container
- uses: ./.github/actions/build-container
with:
image_name: ${{ env.IMAGE_NAME }}
image_tag: ${{ env.IMAGE_TAG }}
# Push to ghcr.io
- name: Push to ghcr.io
id: push
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAG }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
e2e-test:
needs: publish
uses: trustification/trustify-ci/.github/workflows/global-ci.yml@main
with:
server_image: ${{ needs.publish.outputs.image }}
run_api_tests: true
run_ui_tests: true
deploy:
if: ${{ github.repository == 'trustification/trustify' }}
runs-on: ubuntu-22.04
needs:
- publish
- e2e-test
steps:
- name: Log in and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
- name: Install trustify
uses: trustification/trustify-operator/.github/actions/install-trustify@main
env:
SERVER_IMAGE: ${{ needs.publish.outputs.image }}
with:
operator-bundle-image: ghcr.io/trustification/trustify-operator-bundle:latest
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"${{ env.APP_NAME }}"},"spec":{"serverImage":"${{ env.SERVER_IMAGE }}"}}'
namespace: ${{ env.OPENSHIFT_NAMESPACE }}
app-name: ${{ env.APP_NAME }}