chore(deps): pin dependencies #1110
Workflow file for this run
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: Build and Push Container Image On PR Merge | |
| on: | |
| pull_request_target: | |
| types: [closed] | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| issues: write | |
| jobs: | |
| if_merged: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| - name: Set env TAG | |
| run: | | |
| if [ ${{ github.event.pull_request.base.ref }} == "main" ]; then | |
| echo "TAG=latest" >> $GITHUB_ENV | |
| else | |
| echo "TAG=${{ github.event.pull_request.base.ref }}" >> "$GITHUB_ENV" | |
| fi | |
| - name: Build Image | |
| id: build-image | |
| uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 | |
| with: | |
| image: opendatahub-tests | |
| tags: ${{ env.TAG }} | |
| containerfiles: | | |
| ./Dockerfile | |
| - name: Push To Image Registry | |
| id: push-to-registry | |
| uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2 | |
| with: | |
| image: ${{ steps.build-image.outputs.image }} | |
| tags: ${{ steps.build-image.outputs.tags }} | |
| registry: quay.io/opendatahub | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_PASSWORD }} | |
| - name: Add comment to PR | |
| if: always() | |
| env: | |
| URL: ${{ github.event.pull_request.comments_url }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl \ | |
| -X POST \ | |
| $URL \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: token $GITHUB_TOKEN" \ | |
| --data '{ "body": "Status of building tag ${{ env.TAG }}: ${{ steps.build-image.outcome }}. \nStatus of pushing tag ${{ env.TAG }} to image registry: ${{ steps.push-to-registry.outcome }}." }' |