Skip to content

Added import image

Added import image #29

name: rsbc-dh-mail-net-cd
on:
push:
# types: [opened, reopened, edited, synchronize]
branches:
- 'release/test-workflow'
paths:
- "Java/README.md"
- "Java/mail-it/**"
- ".github/workflows/rsbh-dh-mail-net*.yml"
env:
DOCKER_FILE: Java/mail-it/src/Dockerfile
DOCKER_IMAGE_NAME: dh-mail-net
WORKING_DIRECTORY: Java/mail-it/src
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login
uses: docker/login-action@v2
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build & Push the image
working-directory: ${{env.WORKING_DIRECTORY}}
run: |
docker build -t ${{ secrets.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:latest .
docker push ${{ secrets.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:latest
- name: Authenticate and set context for tools namespace
uses: redhat-actions/[email protected]
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL_SILVER }}
openshift_token: ${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}
namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools"
- name: Import new image in Openshift from Artifactory
env:
IMAGE_NAME: ${{ env.DOCKER_IMAGE_NAME }}
run: |
oc import-image $IMAGE_NAME:latest --confirm