Skip to content

Commit

Permalink
update deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanizz committed May 23, 2024
1 parent c0566b9 commit 4c27575
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 45 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/deploy-to-dev.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy IoT Status API

on:
workflow_dispatch:
inputs:
environment:
description: Deployment environment
required: true
default: dev
type: choice
options:
- dev
- prod

run-name: Deploy to ${{ inputs.environment }}

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "npm"

- name: Install dependencies
run: |
sudo apt-get install jq
npm install -g serverless
npm ci
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.ROLE_OIDC }}

- name: Retrieve AWS secrets
run: |
aws secretsmanager get-secret-value --secret-id "streamingStatusApi/env/${{ inputs.environment }}" | jq -r ".SecretString" >> ${{ inputs.environment }}.env
- name: Deploy
run: sls deploy --stage ${{ inputs.environment }}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.19.1

0 comments on commit 4c27575

Please sign in to comment.