Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/serverless/github-action
:zap::octocat: A Github Action for deploying with the Serverless Framework
https://github.com/serverless/github-action
github-actions serverless serverless-framework
Last synced: about 10 hours ago
JSON representation
:zap::octocat: A Github Action for deploying with the Serverless Framework
- Host: GitHub
- URL: https://github.com/serverless/github-action
- Owner: serverless
- License: apache-2.0
- Created: 2018-12-21T22:18:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-06T17:09:42.000Z (about 1 month ago)
- Last Synced: 2025-02-01T09:11:08.497Z (8 days ago)
- Topics: github-actions, serverless, serverless-framework
- Language: Dockerfile
- Homepage:
- Size: 30.3 KB
- Stars: 665
- Watchers: 20
- Forks: 176
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Github Action for Serverless
This Action wraps the [Serverless Framework](https://serverless.com) to enable common Serverless commands.
## This project is looking for maintainers!
If you would like to be a maintainer of this project, please reach out to one of the active [Serverless organization](https://github.com/serverless) members to express your interest.
Welcome, and thanks in advance for your help!
## Usage
An example workflow to deploy a project with serverless v3:
```yaml
name: Deploy master branchon:
push:
branches:
- masterjobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: serverless deploy
uses: serverless/[email protected]
with:
args: deploy
env:
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}
# or if using AWS credentials directly
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
```## Usage with serverless plugins
Change your action in this way, according to [this issue](https://github.com/serverless/github-action/issues/28), thanks to @matthewpoer:
```yaml
- name: Install Plugin and Deploy
uses: serverless/[email protected]
with:
args: -c "serverless plugin install --name && serverless deploy"
entrypoint: /bin/sh
```## Fix "This command can only be run in a Serverless service directory" error
Change your action in this way, according to [this issue](https://github.com/serverless/github-action/issues/53#issuecomment-1059839383), thanks to @nikhuber:
```yaml
- name: Enter dir and deploy
uses: serverless/[email protected]
with:
args: -c "cd ./ && serverless deploy"
entrypoint: /bin/sh
```## Use serverless v1 or v2
Change the action with one of the following:
```yaml
uses: serverless/github-action@v1
```
```yaml
uses: serverless/github-action@v2
```## License
The Dockerfile and associated scripts and documentation in this project are released under the Apache-2 license.