diff --git a/.github/workflows/build_push_ocsci_image.yml b/.github/workflows/build_push_ocsci_image.yml new file mode 100644 index 00000000000..d9b625ce905 --- /dev/null +++ b/.github/workflows/build_push_ocsci_image.yml @@ -0,0 +1,52 @@ +name: Build Container Image + +on: [pull_request] + +# Environment Vars +env: + REGISTRY_USER: ${{ secrets.QUAY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + REGISTRY: quay.io + REGISTRY_NS: ocsci + REGISTRY_IMAGE: ocs-ci-container + +jobs: + buildah: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set time env + run: echo "TIME=$(date --rfc-3339=date)" >> "$GITHUB_ENV" + + - name: Log in to Quay.io + uses: redhat-actions/podman-login@v1 + with: + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_PASSWORD }} + registry: ${{ env.REGISTRY }} + + - name: Buildah Action + id: build-image + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ env.REGISTRY }}/${{ env.REGISTRY_NS }}/${{ env.REGISTRY_IMAGE }} + tags: test55 test55-${{ env.TIME }} + containerfiles: | + ./Docker_files/ocsci_container/Containerfile.ci + + - name: check image name + run: podman images + + - name: Push To quay.io + id: push-to-quay + uses: redhat-actions/push-to-registry@v2 + with: + registry: ${{ env.REGISTRY }}/${{ env.REGISTRY_NS }} + image: ${{ env.REGISTRY_IMAGE }} + tags: ${{ steps.build-image.outputs.tags }} + + - name: Print image url + run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"