-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.53 KB
/
lambda-deploy.yaml
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
name: Deploy to AWS Lambda
on:
workflow_dispatch:
inputs:
name:
description: Who to greet?
default: Allen
workflow_run:
workflows: [ "Run tests" ]
types:
- completed
permissions:
id-token: write
contents: read
jobs:
deploy-lambda:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: production
name: Deploy to AWS Lambda
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: redis
coverage: none
- name: Install php packages
run: composer install --prefer-dist --optimize-autoloader --no-dev
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '21'
- name: Install javascript packages and build the frontend assets
run: |
npm install
npm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::154471991214:role/github_action
aws-region: ap-northeast-1
- name: Copy files to the S3 with the AWS CLI
run: |
aws s3 sync public s3://assets.docfunc.com
- name: Deploy to AWS Lambda
run: |
npm install serverless serverless-lift serverless-api-gateway-throttling
node_modules/.bin/serverless deploy --stage production