Minor update #51
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 | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
jobs: | |
build_container: | |
name: Build and push image | |
runs-on: ubuntu-20.04 | |
env: | |
IMAGE_NAME: ashleys-qc-pipeline | |
steps: | |
- uses: actions/[email protected] | |
- name: Run read-yaml action | |
id: yaml-data | |
uses: jbutcher5/read-yaml@main # You may wish to replace main with a version tag such as '1.6' etc. | |
with: | |
file: "./config/config.yaml" | |
key-path: '["version"]' # Access the runs key then the using key and retuns the value. | |
- name: Display read-yaml output | |
run: echo "${{ steps.yaml-data.outputs.data }}" | |
- name: Print Dockerfile | |
run: | | |
cat ./github-actions-runner/Dockerfile-${{ steps.yaml-data.outputs.data }}.dockerfile | |
- name: Build Image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: "${{ steps.yaml-data.outputs.data }}" | |
dockerfiles: | | |
./github-actions-runner/Dockerfile-${{ steps.yaml-data.outputs.data }}.dockerfile | |
- name: Push To DockerHub | |
id: push-to-dockerhub | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: docker.io/weber8thomas | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Use the image | |
run: echo "New images has been pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" |