项目作者: fleetfn

项目描述 :
🚀 zero-config Fleet Function application deployment using Fleet CLI and Github Actions
高级语言: Shell
项目地址: git://github.com/fleetfn/fleet-action.git
创建时间: 2020-06-28T18:05:24Z
项目社区:https://github.com/fleetfn/fleet-action

开源协议:MIT License

下载


Fleet CLI Github Action

🚀 zero-config Fleet Function application deployment using Fleet CLI and Github Actions.

Usage

Add fleet-action to the workflow for your Serverless Function. The below example will deploy your functions on pushes to the master branch:

  1. name: Deploy
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. deploy:
  8. runs-on: ubuntu-latest
  9. name: Deploy
  10. steps:
  11. - uses: actions/checkout@v2
  12. - name: Publish
  13. uses: fleetfn/fleet-action@0.1.0
  14. with:
  15. apiToken: ${{ secrets.FLEET_API_TOKEN }}
  16. projectId: ${{ secrets.FLEET_PROJECT_ID }}

Configuration

Before you start deploying with Github Actions, you need to configure Fleet CLI using Github’s Secrets feature to add the “API Token” and “Project ID”.

Authentication

  • Go to “Settings -> Secrets”
  • Add your Fleet Personal Access Token (Access the Tokens page on the Fleet console)
  • Add your Project ID (You can get the id in the project settings)

Once you have the secret configured you should now be able to pass the secret on to your action in the with block of your workflow.

  1. jobs:
  2. deploy:
  3. name: Deploy
  4. steps:
  5. uses: fleetfn/fleet-action@0.1.0
  6. with:
  7. apiToken: ${{ secrets.FLEET_API_TOKEN }}
  8. projectId: ${{ secrets.FLEET_PROJECT_ID }}

Production Deployment

Optional

You can also configure the Fleet CLI to deploy to production.

  1. jobs:
  2. deploy:
  3. steps:
  4. uses: fleetfn/fleet-action@0.1.0
  5. with:
  6. apiToken: ${{ secrets.FLEET_API_TOKEN }}
  7. prod: true
  8. projectId: ${{ secrets.FLEET_PROJECT_ID }}

Working Directory

Optional

You can also pass a workingDirectory key to the action. This will allow you to specify a subdirectory of the repo to run the Fleet CLI command.

  1. jobs:
  2. deploy:
  3. steps:
  4. uses: fleetfn/fleet-action@0.1.0
  5. with:
  6. apiToken: ${{ secrets.FLEET_API_TOKEN }}
  7. projectId: ${{ secrets.FLEET_PROJECT_ID }}
  8. workingDirectory: 'api'