5252| --- | --- | --- | --- |
5353| ` args ` | Arguments passed to ` serverless ` | ` true ` |
5454| ` aws-credentials ` | Whether to use credentials stored in the local environment (` AWS_ACCESS_KEY_ID ` , ` AWS_SECRET_ACCESS_KEY ` ) | ` false ` | |
55- | ` entrypoint ` | Serverless entrypoint. For example: ` /bin/sh ` | ` false ` | ` /entrypoint.sh ` |
56- | ` install-packages ` | Comma-separated list of packages to install prior to running ` serverless {args} ` | ` false ` | |
55+ | ` install-packages ` | Space-separated list of packages to install prior to running ` serverless {args} ` | ` false ` | |
5756| ` serverless-version ` | Version of the Serverless Framework to use | ` false ` | ` latest ` |
5857| ` working-directory ` | Folder where your configuration is located | ` false ` | ` . ` |
5958
@@ -62,15 +61,15 @@ jobs:
6261### Minimal example
6362``` yaml
6463 - name : Deploy
65- uses : serverless/github-action@v3.2
64+ uses : serverless/github-action@v4.0
6665 with :
6766 args : deploy
6867` ` `
6968
7069### Use local credentials
7170` ` ` yaml
7271 - name : Deploy with local credentials
73- uses : serverless/github-action@v3.2
72+ uses : serverless/github-action@v4.0
7473 with :
7574 aws-credentials : true # or yes
7675 args : deploy
@@ -79,28 +78,19 @@ jobs:
7978 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
8079` ` `
8180
82- ### Use a different entrypoint
83- ` ` ` yaml
84- - name : Deploy with a different entrypoint
85- uses :
serverless/[email protected] 86- with :
87- entrypoint : /bin/sh
88- args : -c "serverless deploy"
89- ` ` `
90-
9181### Install packages and deploy
9282` ` ` yaml
9383 - name : Install packages and deploy
94- uses : serverless/github-action@v3.2
84+ uses : serverless/github-action@v4.0
9585 with :
96- install-packages : serverless-offline, serverless-prune-plugin
86+ install-packages : serverless-offline serverless-prune-plugin
9787 args : deploy
9888` ` `
9989
10090### Use a particular Serverless Framework CLI version
10191` ` ` yaml
10292 - name : Deploy using a particular version of serverless
103- uses : serverless/github-action@v3.2
93+ uses : serverless/github-action@v4.0
10494 with :
10595 serverless-version : 2
10696 args : deploy
@@ -109,42 +99,17 @@ jobs:
10999### Change your working directory
110100` ` ` yaml
111101 - name : Deploy from a particular working directory
112- uses : serverless/github-action@v3.2
102+ uses : serverless/github-action@v4.0
113103 with :
114104 working-directory : ./foo
115105 args : deploy
116106` ` `
117107
118- ## Usage with serverless plugins
119- Change your action in this way, according to [this issue](https://github.com/serverless/github-action/issues/28), thanks to @matthewpoer:
120- ` ` ` yaml
121- - name : Install Plugin and Deploy
122- uses :
serverless/[email protected] 123- with :
124- args : -c "serverless plugin install --name <plugin-name> && serverless deploy"
125- entrypoint : /bin/sh
126- ` ` `
127-
128- ## Fix "This command can only be run in a Serverless service directory" error
129- Change your action in this way, according to [this issue](https://github.com/serverless/github-action/issues/53#issuecomment-1059839383), thanks to @nikhuber:
130- ` ` ` yaml
131- - name : Enter dir and deploy
132- uses :
serverless/[email protected] 133- with :
134- args : -c "cd ./<your-dir> && serverless deploy"
135- entrypoint : /bin/sh
136- ` ` `
137-
138-
139- ## Use serverless v1 or v2
140- Change the action with one of the following:
108+ ## Use a previous version
109+ Change the action with ` @{version}`, for example:
141110` ` ` yaml
142- uses : serverless/github-action@v1
111+ uses: serverless/github-action@v3.2
143112` ` `
144- ` ` ` yaml
145- uses : serverless/github-action@v2
146- ` ` `
147-
148113
149114# # License
150115
0 commit comments