Skip to content

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

License

Notifications You must be signed in to change notification settings

dylandog13/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

  • aws
  • azure
  • tencent
  • knative
  • alibaba cloud
  • cloudflare workers
  • fn
  • kubeless
  • openwhisk

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@v1

A specific version of Serverless CLI can be installed.

steps:
- uses: Teakowa/setup-serverless@main
  with:
    serverless_version: 2.4.0

Credentials for AWS can be configured.

steps:
- uses: Teakowa/setup-serverless@v1
  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

Credentials for Azure can be configured.

steps:
- uses: Teakowa/setup-serverless@v1
  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

Credentials for Tencent Cloud can be configured.

steps:
- uses: Teakowa/setup-serverless@v1
  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

Credentials for Aliyun can be configured.

steps:
- uses: Teakowa/setup-serverless@v1
  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.

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.4%
  • JavaScript 2.6%