-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_gh_workflow.yaml
More file actions
29 lines (26 loc) · 1.01 KB
/
sample_gh_workflow.yaml
File metadata and controls
29 lines (26 loc) · 1.01 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
name: Deploy image to server
on:
workflow_dispatch:
inputs:
IMAGE:
description: Image with tag
default: "docker.io/library/alpine:3.11"
required: true
CONTAINER:
description: Container name
default: alp
required: true
env:
HOST: "your-app.com:3000/deploy/"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Send deploy request
uses: wei/curl@v1
with:
args: |
-f -v -X POST ${{ env.HOST }} \
-H 'Authorization: ${{ secrets.DEPLOYER_TOKEN }}' \
-H 'Content-Type: application/json' \
-d '{\"name\":\"${{ github.event.inputs.CONTAINER }}\",\"image\":\"${{ github.event.inputs.IMAGE }}\",\"token\":\"${{ secrets.DOCKER_TOKEN }}\",\"user\":\"${{ secrets.DOCKER_USER }}\",\"network\":\"network-name\",\"tty\":true,\"env\":{\"ENV_VAR\":\"${{ secrets.ENV_VAR_VALUE }}\",\"ENV_VAR_2\":\"ENV_VAR2_VALUE\"},\"volumes\":[{\"source\":\"/home/centos/src\",\"target\":\"/var/www\"}]}'