Skip to content

Build and Push Dockerfiles #3

Build and Push Dockerfiles

Build and Push Dockerfiles #3

name: Build and Push Dockerfiles
permissions: read-all
on:
workflow_dispatch:
inputs:
publish_release:
description: Should the license bundle be published to docker-release
type: boolean
required: true
default: false
image_version:
description: Version to associate with the image (default- 'latest')
type: string
required: false
default: 'latest'
env:
PUBLISH_RELEASE: ${{ github.event.inputs.publish_release }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to JFrog
uses: docker/login-action@v1
with:
registry: zowe-docker-snapshot.jfrog.io
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Build and push to snapshot
if: ${{ env.PUBLISH_RELEASE == 'false' }}
id: docker_build_snapshot
uses: docker/build-push-action@v2
with:
push: true
file: licenses/docker/ort.Dockerfile
tags: zowe-docker-snapshot.jfrog.io/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }}
- name: Build and push to release
if: ${{ env.PUBLISH_RELEASE == 'true' }}
id: docker_build_release
uses: docker/build-push-action@v2
with:
push: true
file: licenses/docker/ort.Dockerfile
tags: zowe-docker-release.jfrog.io/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }}