@@ -3,7 +3,6 @@ name: Deploy to AWS Lambda
33on :
44 push :
55 branches :
6- - ' dev'
76 - ' main'
87 workflow_dispatch :
98 inputs :
1716 - main
1817
1918jobs :
20- deploy :
21- name : deploy
22- runs-on : ubuntu-latest
23- strategy :
24- matrix :
25- node-version : [20.x]
26- steps :
27- - uses : actions/checkout@v3
28- - name : Use Node.js ${{ matrix.node-version }}
29- uses : actions/setup-node@v3
30- with :
31- node-version : ${{ matrix.node-version }}
32- - name : Install turbo
33- run : npm install -g turbo
34- - name : Prune api project with turbo
35- run : npx turbo prune admission-api
36- - name : Cache Yarn
37- uses : actions/cache@v4
38- with :
39- path : |
40- node_modules
41- .yarn/cache
42- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
43- restore-keys : |
44- ${{ runner.os }}-yarn-
45- - name : Install dependencies
46- run : |
47- corepack enable
48- yarn set version stable
49- yarn workspaces focus --all
50- working-directory : ' ./out'
51- - name : Generate Prisma
52- run : npx prisma generate --schema ./admission-api/prisma/schema.prisma
53- working-directory : ' ./out'
54- - name : Build api with turbo
55- run : npx turbo run build --filter admission-api
56- working-directory : ' ./out'
57- - name : Install production dependencies
58- run : yarn workspaces focus --all --production
59- - name : serverless deploy
60- uses : serverless/github-action@v3.2
61- with :
62- args : -c "cp ./serverless.yaml ./out/serverless.yaml && cd ./out && serverless deploy --stage ${{ inputs.stage || github.ref_name }}"
63- entrypoint : /bin/sh
64- env :
65- SERVERLESS_ACCESS_KEY : ${{ secrets.SERVERLESS_ACCESS_KEY }}
6619 docker :
6720 runs-on : ubuntu-20.04
6821 steps :
0 commit comments