-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (42 loc) · 1.29 KB
/
Copy pathexample-deploy.yml
File metadata and controls
45 lines (42 loc) · 1.29 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
44
45
name: Example Deployment
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'staging'
type: choice
options:
- staging
- production
command:
description: 'DCD command to run'
required: true
default: 'up'
type: choice
options:
- analyze
- up
- status
- destroy
jobs:
deploy:
name: Deploy to ${{ github.event.inputs.environment }}
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy with DCD
uses: ./dcd-deploy
with:
command: ${{ github.event.inputs.command }}
compose_files: "docker-compose.yml docker-compose.${{ github.event.inputs.environment }}.yml"
env_files: ".env.${{ github.event.inputs.environment }}"
host: ${{ secrets.SSH_HOST }}
user: ${{ secrets.SSH_USER }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
remote_dir: "/opt/myapp-${{ github.event.inputs.environment }}"
no_health_check: "false"
force: ${{ github.event.inputs.command == 'destroy' }}