BE CD for Prod #91
Workflow file for this run
This file contains 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: BE CD for Prod | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
paths: | |
- backend/** | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
with: | |
profile: prod | |
secrets: | |
secret_yml: ${{ secrets.PROD_SECRET_YML }} | |
deploy: | |
needs: [ build ] | |
uses: ./.github/workflows/blue-green.yml | |
with: | |
self_hosted_runner: prod | |
artifact_name: ${{ needs.build.outputs.artifact_name }} | |
jar_name: ${{ needs.build.outputs.jar_name }} | |
profile: prod | |
app_path: ~/app | |
rollback: | |
name: "[Failure] Rollback Deploy" | |
needs: deploy | |
if: failure() && needs.deploy.result == 'failure' | |
uses: ./.github/workflows/shutdown.yml | |
with: | |
self_hosted_runner: prod | |
port: ${{ needs.deploy.outputs.green_port }} | |
deploy-failure-notification: | |
name: "[Failure] Deploy Failure Notification" | |
needs: deploy | |
if: failure() && needs.deploy.result == 'failure' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send notification to Discord # todo | |
run: echo "테스트입니다" | |
configure-nginx: | |
needs: deploy | |
uses: ./.github/workflows/nginx-port-forwarding.yml | |
with: | |
self_hosted_runner: prod | |
app_path: ~/app | |
old_port: ${{ needs.deploy.outputs.blue_port }} | |
new_port: ${{ needs.deploy.outputs.green_port }} | |
rollback-nginx: | |
name: "[Failure] Rollback Nginx" | |
needs: configure-nginx | |
if: failure() && (needs.configure-nginx.result == 'failure') | |
uses: ./.github/workflows/nginx-port-forwarding.yml | |
with: | |
self_hosted_runner: prod | |
app_path: ~/app | |
old_port: ${{ needs.configure-nginx.outputs.new_port }} | |
new_port: ${{ needs.configure-nginx.outputs.old_port }} | |
old_shutdown: true | |
configure-nginx-faliure-notification: | |
name: "[Failure] Nginx Failure Notification" | |
needs: configure-nginx | |
if: failure() && needs.configure-nginx.result == 'failure' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send notification to Discord # todo | |
run: echo "테스트입니다" | |
blue-shutdown: | |
needs: configure-nginx | |
uses: ./.github/workflows/shutdown.yml | |
with: | |
self_hosted_runner: prod | |
port: ${{ needs.configure-nginx.outputs.old_port }} |