-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.34 KB
/
deploy.yml
File metadata and controls
43 lines (39 loc) · 1.34 KB
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
37
38
39
40
41
42
43
name: Deploy
on:
workflow_call:
inputs:
project_name:
description: 'The project (image) name to deploy (without owner prefix)'
required: true
type: string
environment:
description: 'Target environment (e.g. stage, prod)'
required: false
type: string
default: 'stage'
secrets:
WEBHOOK_URL:
description: 'Base URL of webhook server (e.g. https://myserver.com:9000)'
required: true
WEBHOOK_SECRET:
description: 'Webhook secret used in the URL path'
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger deployment of ${{ inputs.project_name }} to ${{ inputs.environment }}
run: |
echo "Deploying project [${{ inputs.project_name }}] to [${{ inputs.environment }}]"
echo "---"
curl --no-buffer --fail-with-body --max-time 300 \
-X POST \
-H "Content-Type: application/json" \
-d '{
"push_data": { "tag": "latest" },
"repository": { "name": "${{ inputs.project_name }}" },
"environment": "${{ inputs.environment }}"
}' \
"${{ secrets.WEBHOOK_URL }}/hooks/${{ secrets.WEBHOOK_SECRET }}/docker-webhook"
echo ""
echo "--- Deployment completed successfully ---"