Skip to content

Web form

Web form #14

name: rsbc-dh-web-form-cd
on:
pull_request:
types: [opened, reopened, edited, synchronize]
branches:
- master
paths:
- "Java/README.md"
- "web_app/**"
- ".github/workflows/rsbh-dh-web-form*.yml"
env:
DOCKER_FILE: web_app/Dockerfile
DOCKER_IMAGE_NAME: dh-web-form
WORKING_DIRECTORY: web_app
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