Skip to content

varun-mohan/setup-serverless

 
 

Repository files navigation

setup-serverless

Build Test Setup Serverless LICENSE LICENSE 996.icu

The Teakowa/setup-serverless action is a JavaScript action that sets up Serverless CLI in your GitHub Actions workflow by:

  • Install a specific version of Serverless CLI

After you've used the action, subsequent steps in the same job can run arbitrary Serverless commands using the GitHub Actions run syntax. This allows most Serverless commands to work exactly like they do on your local command line.

Support Providers

Usage

This action can be run on ubuntu-latest and macos-latest GitHub Actions runners.

The default configuration installs the latest version of Serverless CLI

steps:
- uses: Teakowa/setup-serverless@v2.0.0

A specific version of Serverless CLI can be installed.

steps:
- uses: Teakowa/setup-serverless@v2.0.0
  with:
    serverless_version: 2.4.0

AWS

Credentials for AWS can be configured.

steps:
- uses: Teakowa/setup-serverless@v2.0.0
  with:
    provider: aws
  env:
    AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
    AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}

- run: sls deploy

Azure

Credentials for Azure can be configured.

steps:
- uses: Teakowa/setup-serverless@v2.0.0
  with:
    provider: azure
  env:
    AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
    AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID}}
    AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID}}
    AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET}}

- run: sls deploy

Tencent Cloud

Credentials for Tencent Cloud can be configured.

steps:
- uses: Teakowa/setup-serverless@v2.0.0
  with:
    provider: tencent
  env:
    TENCENT_APPID: ${{ secrets.TENCENT_APP_ID }}
    TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
    TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY}}

- run: sls deploy

If you need to use Tencent Cloud in China, you need to set the environment variable SERVERLESS_PLATFORM_VENDOR to tencent.

You don't need TENCENT_TOKEN, because it is not currently supported.

steps:
- uses: Teakowa/setup-serverless@v2.0.0
  with:
    provider: tencent
  env:
    TENCENT_APPID: ${{ secrets.TENCENT_APP_ID }}
    TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
    TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY}}
    SERVERLESS_PLATFORM_VENDOR: tencent # Must be set here to use in China

- run: sls deploy

Aliyun

Credentials for Aliyun can be configured.

steps:
- uses: Teakowa/setup-serverless@v2.0.0
  with:
    provider: aliyun
  env:
    ALICLOUD_ACCOUNT_ID: ${{ secrets.ALICLOUD_ACCOUNT_ID }}
    ALICLOUD_ACCESS_KEY: ${{ secrets.ALICLOUD_ACCESS_KEY }}
    ALICLOUD_SECRET_KEY: ${{ secrets.ALICLOUD_SECRET_KEY}}

- run: sls deploy

Inputs

The action supports the following inputs:

  • serverless_version: (optional) The version of Serverless CLI to install. Instead of a full version string, you can also specify a constraint string (see Advanced Range Syntax for available range specifications). Examples are: ^2.4, ~2.4, 2.4.x (all three installing the latest available 2.4 version). The special value of latest installs the latest version of Serverless CLI. Defaults to latest.
  • provider: (required) The infrastructure provider of serverless framework. All characters must be lowercase.

Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

License

The code in this repository, unless otherwise noted, is under the terms of both the Anti 996 License and the Apache License (Version 2.0).

About

⚡:octocat: A Github Action for deploying with the Serverless Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.8%
  • JavaScript 2.2%