-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (59 loc) · 2.01 KB
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build container
on:
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
type: choice
options:
- info
- warning
- debug
# tags:
# description: "Test scenario tags"
# required: false
# type: boolean
# environment:
# description: "Environment to run tests against"
# type: environment
# required: true
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 }}"