-
-
Notifications
You must be signed in to change notification settings - Fork 88
80 lines (69 loc) · 2.67 KB
/
deployment.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
name: Deployment
on:
release:
types: [ published ]
permissions:
contents: read
jobs:
docs:
name: Documentation Deployment
if: github.event.release.prerelease != true
runs-on: ubuntu-latest
steps:
- name: Dispatch event to openhab-docs repository
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DOCS_REPO_ACCESS_TOKEN }}
repository: openhab/openhab-docs
event-type: update-openhab-alexa-docs-event
client-payload: '{"ref": "${{ github.ref }}"}'
skill:
name: Skill Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: lambda/package-lock.json
- name: Install ASK CLI
run: npm install -g ask-cli
- name: Generate deployment config
run: node .github/scripts/generateDeployConfig.js
env:
DEPLOY_ENV: ${{ github.event.release.prerelease && 'development' || 'live' }}
FUNCTION_NAME: openhab-alexa
LOG_LEVEL: ${{ github.event.release.prerelease && 'info' || 'error' }}
OPENHAB_BASE_URL: https://myopenhab.org
RELEASE_VERSION: ${{ github.event.release.tag_name }}
SKILL_ID: ${{ secrets.SKILL_ID }}
S3_BUCKET_NA: ${{ secrets.S3_BUCKET_NA }}
S3_BUCKET_EU: ${{ secrets.S3_BUCKET_EU }}
S3_BUCKET_FE: ${{ secrets.S3_BUCKET_FE }}
STACK_ID_NA: ${{ secrets.STACK_ID_NA }}
STACK_ID_EU: ${{ secrets.STACK_ID_EU }}
STACK_ID_FE: ${{ secrets.STACK_ID_FE }}
TESTING_USERNAME: ${{ secrets.TESTING_USERNAME }}
TESTING_PASSWORD: ${{ secrets.TESTING_PASSWORD }}
- name: Deploy skill and AWS resources
run: ask deploy
env:
ASK_ACCESS_TOKEN: ${{ secrets.ASK_ACCESS_TOKEN }}
ASK_REFRESH_TOKEN: ${{ secrets.ASK_REFRESH_TOKEN }}
ASK_VENDOR_ID: ${{ secrets.ASK_VENDOR_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Submit skill for certification
if: github.event.release.prerelease != true
run: node .github/scripts/submitSkillForCertification.js
env:
ASK_ACCESS_TOKEN: ${{ secrets.ASK_ACCESS_TOKEN }}
ASK_REFRESH_TOKEN: ${{ secrets.ASK_REFRESH_TOKEN }}
ASK_VENDOR_ID: ${{ secrets.ASK_VENDOR_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
RELEASE_VERSION: ${{ github.event.release.tag_name }}
SKILL_ID: ${{ secrets.SKILL_ID }}