diff --git a/.github/workflows/ci-build-feeders.yaml b/.github/workflows/ci-build-feeders.yaml index cbe3663a7..b8bfb3e0b 100644 --- a/.github/workflows/ci-build-feeders.yaml +++ b/.github/workflows/ci-build-feeders.yaml @@ -2,7 +2,7 @@ name: Build Data-Feeder on: push: - branches: [dev, main, feature/*] + branches: [feature/*, dev, test] env: REGISTRY: ghcr.io @@ -26,6 +26,9 @@ jobs: echo '::set-output name=APP_REVISION::${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.revision'] }}' id: set-deploy-id + - name: Get deploy ID + run: echo "The DEPLOY_ID is ${{ steps.set-deploy-id.outputs.DEPLOY_ID }}" + - uses: actions/checkout@v2 - name: Login to DockerHub @@ -80,14 +83,13 @@ jobs: namespace: ${{ env.OPENSHIFT_NAMESPACE }} - name: 'Get Helm' + if: github.ref != 'refs/heads/dev' run: | curl -L -O https://get.helm.sh/helm-v3.4.2-linux-amd64.tar.gz tar -xf helm-v3.4.2-linux-amd64.tar.gz - - name: Get deploy ID - run: echo "The DEPLOY_ID is ${{ steps.set-deploy-id.outputs.DEPLOY_ID }}" - - name: 'Deploy Feeder' + if: github.ref != 'refs/heads/dev' run: | export PATH=$PATH:`pwd`/linux-amd64 @@ -140,3 +142,19 @@ jobs: helm repo add bcgov http://bcgov.github.io/helm-charts helm upgrade --install proto-asp-${{ steps.set-deploy-id.outputs.DEPLOY_ID }}-feeder -f values.yaml --history-max 3 bcgov/generic-api + + + - name: Authenticate to Gold and set context + if: github.ref == 'refs/heads/test' + uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ secrets.OPENSHIFT_GOLD_SERVER }} + openshift_token: ${{ secrets.OPENSHIFT_GOLD_TOKEN }} + insecure_skip_tls_verify: true + namespace: ${{ secrets.OPENSHIFT_GOLD_TEST_NAMESPACE }} + + - name: 'Restart Portal Feeder in Gold Test Namespace' + if: github.ref == 'refs/heads/test' + run: | + oc rollout restart deployment/bcgov-aps-portal-feeder-generic-api -n ${{ secrets.OPENSHIFT_GOLD_TEST_NAMESPACE }} +