forked from civitai/civitai
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.11 KB
/
deploy-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Docker Branch Deploy
on:
pull_request:
branches:
- "main"
types: [labeled, opened, reopened, synchronize]
pull_request_review:
types: [submitted]
jobs:
build:
runs-on: ubuntu-latest
if: |
contains(github.event.pull_request.labels.*.name, 'deploy-dev') && (
github.event.review.state == 'APPROVED' || (
startsWith(github.event.pull_request.head.ref, 'feature/') ||
startsWith(github.event.pull_request.head.ref, 'fix/')
)
)
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Trigger dev deploy
uses: convictional/trigger-workflow-and-wait@v1.6.1
with:
owner: civitai
repo: civitai-deployment
workflow_file_name: deploy.yml
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
ref: main
client_payload: |
{ "environment": "dev", "branch": "${{ steps.extract_branch.outputs.branch }}" }
wait_workflow: false