-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (53 loc) · 1.88 KB
/
create-dockerfiles.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
53
54
55
56
57
58
59
60
61
62
63
64
65
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 }}
TARGET_DOCKER_REGISTRY: ""
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set target docker registry
run: |
if [ "$PUBLISH_RELEASE" = true ]; then
echo "TARGET_DOCKER_REGISTRY=zowe-docker-release.jfrog.io" >> $GITHUB_ENV
else
echo "TARGET_DOCKER_REGISTRY=zowe-docker-snapshot.jfrog.io" >> $GITHUB_ENV
fi
- 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: ${{ env.TARGET_DOCKER_REGISTRY }}
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Build and push to release
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: .dockerfiles/ort.Dockerfile
tags: ${{ env.TARGET_DOCKER_REGISTRY }}/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }}
- name: Build and push v2 docker release
id: docker_build_v2
uses: docker/build-push-action@v2
with:
push: true
file: .dockerfiles/ort.zowev2.Dockerfile
tags: ${{ env.TARGET_DOCKER_REGISTRY }}/ompzowe/zowecicd-license-base:v2-${{ github.event.inputs.image_version }}