Merge pull request #19 from msherif1234/fix_typo #22
This file contains 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 Images | |
on: | |
push: | |
branches: | |
- main | |
- release-* | |
jobs: | |
build_push: | |
if: (github.repository == 'netobserv/must-gather') | |
name: Build and Push Images | |
runs-on: ubuntu-latest | |
env: | |
REGISTRY_USERNAME: netobserv+github_ci | |
REGISTRY_PASSWORD: ${{ secrets.QUAY_SECRET }} | |
REGISTRY_NAMESPACE: netobserv | |
MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x | |
steps: | |
- name: Checkout the latest code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Check build | |
run: | | |
make lint MUST_GATHER_IMAGE=$REGISTRY_NAMESPACE/must-gather | |
- name: Build image | |
run: | | |
MULTIARCH_TARGETS="${{ env.MULTIARCH_TARGETS }}" make image-build MUST_GATHER_IMAGE=$REGISTRY_NAMESPACE/must-gather | |
- name: podman login to quay.io | |
uses: redhat-actions/podman-login@v1 | |
with: | |
username: ${{ env.REGISTRY_USERNAME }} | |
password: ${{ env.REGISTRY_PASSWORD }} | |
registry: quay.io | |
- name: get short sha | |
run: | | |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Push image | |
run: | | |
IMAGE_TAG=${{ env.short_sha }} | |
MULTIARCH_TARGETS="${{ env.MULTIARCH_TARGETS }}" make build MUST_GATHER_IMAGE=$REGISTRY_NAMESPACE/must-gather |