-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
81 lines (64 loc) · 2.68 KB
/
deploy.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# deploy.yml
# Use this workflow to deploy fixed environments (live,dev,test)
#
name: Deploy to Live
on:
# Allows running deploy task manually.
workflow_dispatch:
# Only act on pushes to main branch
push:
branches:
- main
jobs:
deploy:
name: Deploy to ${{matrix}}
# Use a matrix for deploying multiple sites.
strategy:
matrix:
include:
- name: live
path: "Sites/${{ github.repository }}/live"
domains: "live.mysite.com,www.mysite.com"
git_reference: "main"
- name: dev
path: "Sites/${{ github.repository }}/dev"
domains: "dev.mysite.com"
git_reference: "main"
# Send a link to GitHub's Deployment API to show to users on GitHub.com.
environment:
name: mysite.${{ matrix.name }}
url: http://${{ matrix.name }}.mysite.com
# The label of the runner you wish to use.
# Operations Site Runner automatically adds the server's hostname as a label.
# Use the hostname label to be sure the workflow runs on the right server.
runs-on: prod.myserver.com
steps:
# Runs site-server-ddev GitHub Action.
# See https://github.com/operations-project/site-runner-ddev
- name: Deploy site
uses: operations-project/site-runner-ddev@main
with:
# For continuous delivery, set to a branch. Merges to the branch will trigger deployment.
# For manual delivery, you can set this to a tag.
git-reference: ${{ matrix.git_reference }}
# The path to install the site, relative to $HOME
path: ${{ matrix.path }}
# Set to "yes" to run the "sync-command". THIS WILL DESTROY THE SITE DATA.
# Leave out for sites that should not sync.
sync: "yes"
# Whether or not to run "ddev start". There may be downtime.
ddev-start: "yes"
# The DDEV project name to use for this environment. Must be unique on this server.
ddev-project-name: "mysite.${{ matrix.name }}"
# SSH Settings.
# Add to your repository secrets.
# Only needed if this site needs to sync from a remote server.
# Value of ~/.ssh/known_hosts.
# Command to get SSH_KNOWN_HOSTS:
# ssh-keyscan -H yourliveserver.com -H github.com
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
# A private key that can access the live site for syncing.
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# A list of domains to apply to this environment. (Must be a string that parses as a yaml array because github actions inputs must be strings)
ddev-fqdns: ${{ matrix.domains }}