MINESPACE - Promote TEST #610
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: MINESPACE - Promote TEST | |
| on: | |
| workflow_dispatch: | |
| env: | |
| ORIG_TAG: dev | |
| PROMOTE_TAG: test | |
| IMAGE: minespace | |
| jobs: | |
| promote-image: | |
| name: promote-image | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Install oc | |
| uses: redhat-actions/openshift-tools-installer@v1 | |
| with: | |
| oc: "4.7" | |
| - name: oc login | |
| run: | | |
| oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }} | |
| - name: Promote from dev to test | |
| run: | | |
| oc -n ${{secrets.NS_TOOLS}} tag \ | |
| ${{ secrets.NS_TOOLS }}/${{ env.IMAGE }}:${{ env.ORIG_TAG }} \ | |
| ${{ secrets.NS_TOOLS }}/${{ env.IMAGE }}:${{ env.PROMOTE_TAG }} | |
| trigger-gitops: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| needs: promote-image | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Setup SSH Agent | |
| uses: ./.github/actions/setup-ssh | |
| with: | |
| ssh-private-key: ${{ secrets.GITOPS_REPO_DEPLOY_KEY }} | |
| - name: Git Ops Push | |
| run: ./gitops/commit.sh ${{ env.IMAGE }} dev test ${{ github.actor }} | |
| - name: Install oc | |
| if: ${{ env.NEEDS_ROLLOUT=='true' }} | |
| uses: redhat-actions/openshift-tools-installer@v1 | |
| with: | |
| oc: "4.7" | |
| - name: Setup ArgoCD CLI | |
| uses: imajeetyadav/argocd-cli@v1 | |
| with: | |
| version: v2.7.9 # optional | |
| - name: oc login | |
| if: ${{ env.NEEDS_ROLLOUT=='true' }} | |
| run: oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }} | |
| - name: Notification | |
| if: ${{ env.NEEDS_ROLLOUT=='true' }} | |
| run: ./gitops/watch-deployment.sh minespace test ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} ${{ secrets.ARGOCD_SERVER }} ${{ secrets.ARGO_CD_CLI_JWT }} | |
| run-if-failed: | |
| runs-on: ubuntu-24.04 | |
| needs: [trigger-gitops] | |
| if: always() && (needs.trigger-gitops.result == 'failure') | |
| steps: | |
| - name: Notification | |
| run: ./gitops/watch-deployment.sh minespace test ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 1 |