|
| 1 | +name: Koku UI OnPrem - Push to main |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - stage-onprem |
| 7 | + tags: |
| 8 | + - 'onprem-*' |
| 9 | +env: |
| 10 | + QUAY_ORG: quay.io/insights-onprem |
| 11 | + QUAY_UI_REPO: koku-ui-onprem |
| 12 | + |
| 13 | +jobs: |
| 14 | + generate-tags: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + image_tags: ${{ steps.get-tags.outputs.image_tags }} |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + fetch-tags: true |
| 23 | + |
| 24 | + - name: Generate image tags |
| 25 | + id: get-tags |
| 26 | + run: | |
| 27 | + if ${{ github.ref_type == 'tag' }}; then |
| 28 | + # The images tags will match the Release tag |
| 29 | + image_tags=( ${{ github.ref_name }} ) |
| 30 | + image_tags=${image_tags#v} # remove the leading v prefix for version |
| 31 | +
|
| 32 | + echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT |
| 33 | + echo "image_tags=${image_tags[@]}" |
| 34 | +
|
| 35 | + else |
| 36 | + image_tags=( latest-${GITHUB_SHA} latest ${version} ) |
| 37 | + echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT |
| 38 | + echo "image_tags=${image_tags[@]}" |
| 39 | + fi |
| 40 | +
|
| 41 | + publish-onprem-ui: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + needs: [generate-tags] |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Build |
| 48 | + id: build |
| 49 | + uses: redhat-actions/buildah-build@v2 |
| 50 | + with: |
| 51 | + image: ${{ env.QUAY_UI_REPO }} |
| 52 | + tags: ${{ needs.generate-tags.outputs.image_tags }} |
| 53 | + labels: | |
| 54 | + org.insights-onprem.koku-ui-onprem.github.repository=${{ github.repository }} |
| 55 | + org.insights-onprem.koku-ui-onprem.github.actor=${{ github.actor }} |
| 56 | + org.insights-onprem.koku-ui-onprem.github.run_id=${{ github.run_id }} |
| 57 | + org.insights-onprem.koku-ui-onprem.github.sha=${{ github.sha }} |
| 58 | + org.insights-onprem.koku-ui-onprem.github.ref_name=${{ github.ref_name }} |
| 59 | + extra-args: | |
| 60 | + --ulimit nofile=10000:10000 |
| 61 | + containerfiles: apps/koku-ui-onprem/Containerfile |
| 62 | + context: . |
| 63 | + |
| 64 | + - name: Push to Quay.io |
| 65 | + id: push |
| 66 | + uses: redhat-actions/[email protected] |
| 67 | + with: |
| 68 | + image: ${{ steps.build.outputs.image }} |
| 69 | + tags: ${{ needs.generate-tags.outputs.image_tags }} |
| 70 | + registry: ${{ env.QUAY_ORG }} |
| 71 | + username: ${{ secrets.QUAY_INSIGHTS_ONPREM_ROBOT_USERNAME }} |
| 72 | + password: ${{ secrets.QUAY_INSIGHTS_ONPREM_ROBOT_PASSWORD }} |
0 commit comments