-
-
Notifications
You must be signed in to change notification settings - Fork 88
83 lines (72 loc) · 2.87 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
81
82
83
name: Deployment
on:
release:
types: [ published ]
workflow_dispatch:
permissions:
contents: read
jobs:
docs:
name: Documentation Deployment
if: github.event_name == 'release' && !github.event.release.prerelease
runs-on: ubuntu-latest
steps:
- name: Dispatch event to openhab-docs repository
uses: peter-evans/repository-dispatch@v3
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_name == 'release' && !github.event.release.prerelease && 'live' || 'development' }}
FUNCTION_NAME: openhab-alexa
LOG_LEVEL: ${{ github.event_name == 'release' && !github.event.release.prerelease && 'error' || 'info' }}
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_name == 'release' && !github.event.release.prerelease
run: >
ask smapi submit-skill-for-certification
--skill-id "${{ secrets.SKILL_ID }}"
--publication-method "AUTO_PUBLISHING"
--version-message "Release ${{ github.event.release.tag_name }}"
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 }}