-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.28 KB
/
push.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
name: Publish after push
on:
push:
branches:
- main
env:
QUAY_REGISTRY: quay.io
RH_REGISTRY: registry.redhat.io
defaults:
run:
shell: bash
jobs:
build_all:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Dump GitHub context
id: github_context_step
run: echo '${{ toJSON(github) }}'
- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
registry: ${{ env.QUAY_REGISTRY }}
- name: Log in to registry.redhat.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.RH_REGISTRY_USER }}
password: ${{ secrets.RH_REGISTRY_TOKEN }}
registry: ${{ env.RH_REGISTRY }}
- name: Build All
id: build
run: |
set -x
SHA=$(git rev-parse --short HEAD)
DATE=$(date --utc +%Y%m%d%H%M)
make version
make all SHA=${SHA} DATE=${DATE} RELEASE=1 FORCE_BUILD=true
. versions.cfg
echo "version=${VERSIONS[nfv-example-cnf-index]}" >> "$GITHUB_OUTPUT"
publish_dci_component:
runs-on: ubuntu-latest
needs: build_all
steps:
- name: Create DCI components
id: dci
uses: dci-labs/dci-component@v1
with:
dciClientId: ${{ secrets.DCI_CLIENT_ID }}
dciApiSecret: ${{ secrets.DCI_API_SECRET }}
dciTopics: 'all-OCP'
componentName: nfv-example-cnf-index
componentVersion: v${{ needs.build_all.outputs.version }}
componentData: '{"url":"${{ env.QUAY_REGISTRY }}/rh-nfv-int/nfv-example-cnf-catalog"}'
componentRelease: ga
- name: Results
run: |
echo "## DCI components" >> ${GITHUB_STEP_SUMMARY}
echo "" >> ${GITHUB_STEP_SUMMARY}
echo "\`\`\`JSON" >> ${GITHUB_STEP_SUMMARY}
<<<'${{ steps.dci.outputs.components }}' jq '.[] | del(.component.jobs)' | grep -v team_id >> ${GITHUB_STEP_SUMMARY}
echo "\`\`\`" >> ${GITHUB_STEP_SUMMARY}
echo "" >> ${GITHUB_STEP_SUMMARY}