Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[WEAV-000] 개발서버 자동 트리깅 (#262)
Browse files Browse the repository at this point in the history
Co-authored-by: dojin <[email protected]>
  • Loading branch information
waterfogSW and dojinyou authored May 1, 2024
1 parent 2454c58 commit cd741e7
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/develop_server_deployer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
description: 'Image version tag (e.g., 0.2411.135 or latest)'
required: true
default: 'latest'
workflow_run:
workflows: ["Develop Server Integrator (CI)"]
types:
- completed

jobs:
deploy:
Expand All @@ -22,6 +26,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get triggered workflow run
uses: actions/github-script@v6
id: triggered_workflow_run
with:
script: |
const eventPayload = require(process.env.GITHUB_EVENT_PATH);
const workflowRun = eventPayload.workflow_run;
return {
head_branch: workflowRun.head_branch,
head_sha: workflowRun.head_sha,
version: `${workflowRun.head_branch}.${workflowRun.id}`
};
- name: Set version from triggered workflow
if: github.event_name == 'workflow_run'
run: echo "version=${{ steps.triggered_workflow_run.outputs.version }}" >> $GITHUB_OUTPUT

- name: Send discord notification (develop server deploy start)
uses: appleboy/discord-action@master
with:
Expand All @@ -32,7 +53,7 @@ jobs:
>
> 🛢️ Repository : ${{ github.repository }}
> 🎋 Branch : ${{ github.ref }}
> 📐 Version : ${{ github.event.inputs.version }}
> 📐 Version : ${{ steps.triggered_workflow_run.outputs.version || github.event.inputs.version }}
> 🔁 Run Attempt : ${{ github.run_attempt }}
> 🤗 Actor : ${{ github.triggering_actor }}
Expand Down Expand Up @@ -154,6 +175,7 @@ jobs:
validate_version:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Validate version format
run: |
Expand Down

0 comments on commit cd741e7

Please sign in to comment.