Build and push - pipeline image #2
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 image | |
| on: | |
| workflow_dispatch: | |
| env: | |
| PROJECT_DIR: "." | |
| jobs: | |
| build-and-push-image: | |
| name: Build and Push container image | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - name: rec-sys-workflow | |
| context: . | |
| image-name: rec-sys-workflow | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Quay.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_PASSWORD }} | |
| - name: Set version from run number | |
| id: version | |
| run: | | |
| echo "tag=v1.0.${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT | |
| - name: Build and push ${{ matrix.name }} | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ${{ matrix.context }} | |
| file: Containerfile | |
| push: true | |
| tags: quay.io/ecosystem-appeng/${{ matrix.image-name }}:${{ steps.version.outputs.tag }} | |
| build-args: | | |
| IMAGE_TAG=${{ steps.version.outputs.tag }} |