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

[WEAV-000] 개발서버 자동 트리깅 #262

Merged
merged 2 commits into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading