Continuous Deployment with Fleet CLI and GitHub Actions
This guide shows you how to configure your Fleet functions to be deployed continuously from your GitHub repository.
To start, let's use one of our examples in the Fleet collection. It's a simple example that you can easily replicate in your projects.
https://github.com/fleetfn/examples
to your own GitHub repository.FLEET_API_TOKEN
with the token value from step 2 and create another new secret called FLEET_PROJECT_ID
with the value of the project ID from step 3.github/workflow/main.yml
with these contentsname: Deploy
on:
pull_request:
branches: ['master', 'stable']
push:
branches: ['master', 'stable']
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v2
- name: Publish
uses: fleetfn/fleet-[email protected]
with:
apiToken: ${{ secrets.FLEET_API_TOKEN }}
projectId: ${{ secrets.FLEET_PROJECT_ID }}
workingDirectory: 'simple-http-endpoint'
This is where the magic happens! The push triggers a deploy to Fleet and from now on whenever you make a change, your functions will be automatically be redeployed.
If you want to watch the process steps, go to the Repository, and select the Actions tab, where you can view the activity logs of the commands that are running or previous logs.
This is the common deployment process that you can start, but you can take advantage of the GitHub Actions environment to manage more complex deployments such as:
Anything else you can dream of.