GitHub action container #5
Workflow file for this run
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 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 }}" |