-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (47 loc) · 1.84 KB
/
build-container-image.yml
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
name: build-push-to-quay.io
on:
workflow_dispatch:
inputs:
final_image_tag:
description: 'Container Image Tag'
required: true
default: 'latest'
jobs:
container-image-chain-build-publish:
runs-on: ubuntu-latest
env:
REGISTRY_CONTEXT: quay.io/rafaeltuelho
WEBPACK_IMAGE_NAME: rafaeltuelho/decision-service-s2i-webpack
FINAL_IMAGE_NAME: decision-service-webclient
TAGS: latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
# Setup S2i and Build the nodejs webpack container base image
- name: Build ReactJS webpack base image using Nodeshift
id: build_image
uses: redhat-actions/s2i-build@v2
with:
path_context: '.'
# Builder image for NodeJS webapps
builder_image: 'nodeshift/ubi8-s2i-web-app:latest'
image: ${{ env.WEBPACK_IMAGE_NAME }}
tags: ${{ env.TAGS }}
- name: Login to Red Hat Container Registry
uses: docker/login-action@v1
with:
registry: registry.redhat.io
username: ${{ secrets.REDHAT_IO_USERNAME }}
password: ${{ secrets.REDHAT_IO_TOKEN }}
# Chain image build using Nginx
- name: Build the final image using Docker chained build
run: docker build . --file Dockerfile --tag ${{ env.REGISTRY_CONTEXT }}/${{ env.FINAL_IMAGE_NAME }}:${{ github.event.inputs.final_image_tag }}
- name: Login to Quay.io Container Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
# Chain image build using Nginx
- name: Push final image to Quay.io/rafaeltuelho
run: docker push ${{ env.REGISTRY_CONTEXT }}/${{ env.FINAL_IMAGE_NAME }}:${{ github.event.inputs.final_image_tag }}