Production deploy #93
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: 'Production deploy' | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| message: | |
| description: 'Reason for the production deploy' | |
| required: true | |
| default: 'Scheduled production deploy' | |
| jobs: | |
| discord-notify-start: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Discord notification for start | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| uses: Ilshidur/action-discord@master | |
| with: | |
| args: 'Maestro production deploy started: "${{ inputs.message }}" by ${{ github.actor }}' | |
| call-docker-build: | |
| uses: ./.github/workflows/docker_images.yml | |
| secrets: inherit | |
| with: | |
| GIT_OWNER: 'kernelci' | |
| GIT_BRANCH: 'main' | |
| deploy-k8s-production: | |
| runs-on: ubuntu-latest | |
| needs: call-docker-build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: kernelci/kernelci-deploy | |
| ref: main | |
| - name: Set up kubectl | |
| uses: azure/k8s-set-context@v4 | |
| with: | |
| method: kubeconfig | |
| kubeconfig: ${{ secrets.KUBECONFIG }} | |
| - name: Deploy to production | |
| run: | | |
| cd kubernetes | |
| ./api-production-update.sh workflow | |
| - name: Discord notification for end | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| uses: Ilshidur/action-discord@master | |
| with: | |
| args: 'Maestro production deploy completed.' | |
| discord-notify-failure: | |
| runs-on: ubuntu-latest | |
| if: failure() | |
| needs: [discord-notify-start, call-docker-build, deploy-k8s-production] | |
| steps: | |
| - name: Notify failure to Discord | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| uses: Ilshidur/action-discord@master | |
| with: | |
| args: '❌ Maestro production deploy failed.' |