Skip to content

Deployment

Deployment #39

Workflow file for this run

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 }}