132 lines (129 loc) · 4.12 KB
/
cd.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: cd
on:
pull_request:
types: [synchronize,opened,reopened]
jobs:
validate-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Generate fake SSL cert
run: |
openssl req -x509 -newkey rsa:1024 -subj '/CN=example.com' -nodes -keyout key.pem -out cert.pem
- name: Test config
uses: docker://homeassistant/home-assistant:0.102.1
env:
ALARM_PASSWORD: ""
ALARM_PLATFORM: alarmdotcom
ALARM_USERNAME: ""
API_PASSWORD: ""
APPLETV_LOGIN_ID: ""
BEDROOM_APPLE_TV_IP: ""
BEDROOM_TV_IP: ""
BEDROOM_TV_MAC: ""
CAMERA_DASH: http://example.com
CAMERA_URL_1: http://example.com
CAMERA_URL_2: http://example.com
CAMERA_URL_3: http://example.com
CAMERA_URL_4: http://example.com
CAMERA_URL_5: http://example.com
CAMERA_URL_6: http://example.com
CAMERA_URL_7: http://example.com
CAMERA_URL_8: http://example.com
CAMERA_URL_9: http://example.com
CLIMATE_DASH: http://example.com
DB_URL: ""
DESK_HID_IDLE_TIME_RESOURCE: http://example.com
DESK_CAMERA_RESOURCE: http://example.com
ELEVATION: 0
FORECAST_API_KEY: ""
GATEWAY_LINK: http://example.com
GRAFANA_LINK: http://example.com
GRAPHITE_LINK: http://example.com
IFTTT_KEY: ""
JESSE_MUSIC_ROOM_IP: "0.0.0.0"
JPHONE_PUSH_TARGET: ""
KITCHEN_LAT: 0
KITCHEN_LONG: 0
LAT: 0
LETSENCRYPT_EMAIL: ""
LETSENCRYPT_HOST: ""
LIVING_LAT: 0
LIVING_LONG: 0
LONG: 0
MASTER_LAT: 0
MASTER_LONG: 0
MOTION_LINK: http://example.com
MPR_API_IP: ""
MPR_API_PORT: 1
MYQ_PASSWORD: ""
MYQ_USERNAME: ""
OFFICE_APPLE_TV_IP: ""
OFFICE_LAT: 0
OFFICE_LONG: 0
OFFICE_TV_IP: ""
OFFICE_TV_MAC: ""
ROOMBA_IP: "0.0.0.0"
ROOMBA_BLID: ""
ROOMBA_PASSWORD: ""
ROUTER_LINK: http://example.com
SELF_LINK: http://example.com
SLACK_API_KEY: ""
SMOKEPING_LINK: http://example.com
SSL_CERTIFICATE: cert.pem
SSL_KEY: key.pem
TRUSTED_NETWORK_1: 0.0.0.0/0
TRUSTED_NETWORK_2: 0.0.0.0/0
TRUSTED_NETWORK_3: 0.0.0.0/0
UNIFI_IP: 0.0.0.0
UNIFI_USERNAME: foo
UNIFI_PASSWORD: bar
UNIFI_PORT: "8443"
VERA_LINK: http://example.com
VERA_URL: http://example.com
VIRTUAL_HOST: example.com
VIRTUAL_NETWORK: ""
VIRTUAL_PORT: ""
with:
entrypoint: ./script/cibuild
deploy:
runs-on: ubuntu-latest
needs: validate-config
steps:
- uses: maxkomarychev/oction-create-deployment@v0.7.1
id: create-deployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.push.before }}
auto_merge: "true"
required_contexts: YAMBURGER,validate-config
production_environment: "true"
- uses: maxkomarychev/oction-create-deployment-status@v0.7.1
id: pending
with:
token: ${{ secrets.GITHUB_TOKEN }}
deployment_id: ${{ steps.create-deployment.outputs.id }}
state: pending
- name: 'Deploy home-assistant'
env:
HASS_TOKEN: ${{ secrets.HASS_TOKEN }}
HASS_URL: ${{ secrets.HASS_URL }}
run: |
curl \
--silent --output /dev/null \
-H "Authorization: Bearer $HASS_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"sha\": \"$GITHUB_SHA\"}" \
"$HASS_URL/api/services/script/deploy"
- uses: maxkomarychev/oction-create-deployment-status@v0.7.1
if: success()
with:
token: ${{ secrets.GITHUB_TOKEN }}
deployment_id: ${{ steps.create-deployment.outputs.id }}
state: success
- uses: maxkomarychev/oction-create-deployment-status@v0.7.1
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
deployment_id: ${{ steps.create-deployment.outputs.id }}
state: failure