-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (75 loc) · 2.75 KB
/
reusable-deploy-job.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
########################################################
# Reusable deploy workflow #
########################################################
name: deploy
on:
workflow_call:
inputs:
alexaSkillStage:
required: true
type: string
debug:
required: true
type: string
target:
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.target }}
name: deploy-job
permissions:
id-token: write
contents: read
env:
ALEXA_SKILL_STAGE: ${{ inputs.alexaSkillStage }}
DEBUG: ${{ inputs.debug }}
ALEXA_AMAZON_CLIENT_ID: ${{ secrets.ALEXA_AMAZON_CLIENT_ID }}
ALEXA_AMAZON_CLIENT_SECRET: ${{ secrets.ALEXA_AMAZON_CLIENT_SECRET }}
ALEXA_SKILL_ID: ${{ secrets.ALEXA_SKILL_ID }}
AUTH_HEADER: ${{ secrets.AUTH_HEADER }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
MICROSOFT_TENANT_ID: ${{ secrets.MICROSOFT_TENANT_ID }}
MICROSOFT_CLIENT_ID: ${{ secrets.MICROSOFT_CLIENT_ID }}
LARA_SECRET: ${{ secrets.LARA_SECRET }}
SES_EMAIL: ${{ secrets.SES_EMAIL }}
SUPPORT_MAIL: ${{ secrets.SUPPORT_MAIL }}
URL_ORIGIN: ${{ secrets.URL_ORIGIN }}
COMPANY_ABBREVIATION: ${{ secrets.COMPANY_ABBREVIATION }}
OLD_COMPANY_NAME: ${{ secrets.OLD_COMPANY_NAME }}
NEW_COMPANY_NAME: ${{ secrets.NEW_COMPANY_NAME }}
AVATAR_URL: ${{ secrets.AVATAR_URL }}
LARA_VERSION: ${{ github.ref_name }}
SES_REGION: ${{ secrets.SES_REGION }}
FRONTEND_URL: ${{ secrets.FRONTEND_URL }}
BACKEND_URL: ${{ secrets.BACKEND_URL }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: actions/cache@v4
with:
path: |
node_modules
packages/*/node_modules
.yarn
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-in-${{ github.ref_name }}
- run: npm i -g serverless
- name: Download built dist and lib
uses: actions/download-artifact@v4
with:
name: dist-and-lib
path: packages
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-deploy-user
role-session-name: github-deployment
- name: Deploy Frontend
run: serverless s3sync bucket --bucket ${{ secrets.COMPANY_ABBREVIATION }}-lara-frontend-${{ inputs.target }}
- name: Deploy Backends
run: serverless deploy --stage ${{ inputs.target }}