Merge pull request #324 from celdrake/EDM-1506-remove-check-for-updat… #330
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: Push to main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '**' | |
| env: | |
| QUAY_ORG: quay.io/flightctl | |
| QUAY_CHARTS: quay.io/flightctl/charts | |
| QUAY_STANDALONE_REPO: flightctl-ui | |
| QUAY_OCP_REPO: flightctl-ocp-ui | |
| jobs: | |
| generate-tags: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image_tags: ${{ steps.get-tags.outputs.image_tags }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Generate image tags | |
| id: get-tags | |
| run: | | |
| if ${{ github.ref_type == 'tag' }}; then | |
| # The images tags will match the Release tag | |
| image_tags=( ${{ github.ref_name }} ) | |
| image_tags=${image_tags#v} # remove the leading v prefix for version | |
| echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT | |
| echo "image_tags=${image_tags[@]}" | |
| else | |
| version=$(git describe --long --tags --exclude latest) | |
| version=${version#v} # remove the leading v prefix for version | |
| # The images tags are taken from git | |
| image_tags=( latest-${GITHUB_SHA} latest ${version} ) | |
| echo "image_tags=${image_tags[@]}" >> $GITHUB_OUTPUT | |
| echo "image_tags=${image_tags[@]}" | |
| fi | |
| publish-flightctl-ui: | |
| runs-on: ubuntu-latest | |
| needs: [generate-tags] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build | |
| id: build | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.QUAY_STANDALONE_REPO }} | |
| tags: ${{ needs.generate-tags.outputs.image_tags }} | |
| labels: | | |
| org.flightctl.flightctl-ui.github.repository=${{ github.repository }} | |
| org.flightctl.flightctl-ui.github.actor=${{ github.actor }} | |
| org.flightctl.flightctl-ui.github.run_id=${{ github.run_id }} | |
| org.flightctl.flightctl-ui.github.sha=${{ github.sha }} | |
| org.flightctl.flightctl-ui.github.ref_name=${{ github.ref_name }} | |
| extra-args: | | |
| --ulimit nofile=10000:10000 | |
| containerfiles: Containerfile | |
| context: . | |
| - name: Push to Quay.io | |
| id: push | |
| uses: redhat-actions/push-to-registry@v2.7 | |
| with: | |
| image: ${{ steps.build.outputs.image }} | |
| tags: ${{ needs.generate-tags.outputs.image_tags }} | |
| registry: ${{ env.QUAY_ORG }} | |
| username: ${{ secrets.QUAY_FLIGHTCTL_INFRA_ROBOT_USERNAME }} | |
| password: ${{ secrets.QUAY_FLIGHTCTL_INFRA_ROBOT_PASSWORD }} | |
| publish-flightctl-ocp-ui: | |
| runs-on: ubuntu-latest | |
| needs: [generate-tags] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build | |
| id: build | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.QUAY_OCP_REPO }} | |
| tags: ${{ needs.generate-tags.outputs.image_tags }} | |
| labels: | | |
| org.flightctl.flightctl-ui.github.repository=${{ github.repository }} | |
| org.flightctl.flightctl-ui.github.actor=${{ github.actor }} | |
| org.flightctl.flightctl-ui.github.run_id=${{ github.run_id }} | |
| org.flightctl.flightctl-ui.github.sha=${{ github.sha }} | |
| org.flightctl.flightctl-ui.github.ref_name=${{ github.ref_name }} | |
| extra-args: | | |
| --ulimit nofile=10000:10000 | |
| containerfiles: Containerfile.ocp | |
| context: . | |
| - name: Push to Quay.io | |
| id: push | |
| uses: redhat-actions/push-to-registry@v2.7 | |
| with: | |
| image: ${{ steps.build.outputs.image }} | |
| tags: ${{ needs.generate-tags.outputs.image_tags }} | |
| registry: ${{ env.QUAY_ORG }} | |
| username: ${{ secrets.QUAY_FLIGHTCTL_INFRA_ROBOT_USERNAME }} | |
| password: ${{ secrets.QUAY_FLIGHTCTL_INFRA_ROBOT_PASSWORD }} |