Project refactor (#125) #110
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} |