From f50a8839965f0c8d0391c412c8aee9201c88ae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Thu, 30 Nov 2023 15:59:15 +0100 Subject: [PATCH] Add workflow to deploy to production --- .github/workflows/deploy.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 305e0f06..cb9bb3c6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,7 @@ on: push: branches: - "main" + - "production" paths-ignore: - '.gitignore' - 'CODEOWNERS' @@ -33,12 +34,21 @@ jobs: distribution: temurin java-version: 17 - - name: Log in to OpenShift + - name: Log in to OpenShift (Dev) + if: ${{ github.ref == 'refs/heads/main' }} uses: redhat-actions/oc-login@v1 with: openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - namespace: ${{ env.OPENSHIFT_NAMESPACE }} + namespace: ${{ env.OPENSHIFT_NAMESPACE_DEV }} + + - name: Log in to OpenShift (Prod) + if: ${{ github.ref == 'refs/heads/production' }} + uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + namespace: ${{ env.OPENSHIFT_NAMESPACE_PROD }} - name: Delete problematic image run: oc delete is ubi-quarkus-native-binary-s2i || true