GitHub Actions

Use custom GitHub Actions to deploy your site to Fleek instead of using the CLI’s Site deploy command. This approach is suitable if you have an existing repository that you want to deploy on Fleek Platform.

The Fleek-platform CLI can generate a GitHub Action (yaml) for deploying a Fleek Site by automating the process of building and publishing it. It ensures that your latest changes are quickly and consistently pushed whenever you update the repository, e.g. on main branch update.

Create a GitHub Action for Fleek Sites deployment

First, ensure that you have initialized a Fleek Site, if you haven’t done already you can learn about it here.

After initializing a Fleek Site, you can run the ci (Continuous Integration) command:

fleek sites ci

A wizard will guide you to create a GitHub Action configuration file of type json, js or ts, e.g. fleek.config.json.

The process saves the file in the local GitHub Workflows directory. You can optionally customize the path.

.github/workflows/fleek-deploy.yaml

Configure the GitHub repository settings

On Create a GitHub Action completion, the wizard will display the token and projectId to have configured in the GitHub repository settings, e.g. GitHub Secrets.

Here’s an example:

Name              Value
-------------------------------------------
FLEEK_TOKEN       <PERSONAL-ACCESS-TOKEN>
FLEEK_PROJECT_ID  <PROJECT-ID>

Next, you can navigate to the GitHub’s Actions tab. Commit and push a change to your repository in order to trigger the Fleek CI to be executed.

You can access the Actions tab of you repository at https://github.com/<ORGANIZATION>/<REPOSITORY-NAME>, e.g. for the Fleek’s Website repository you’d access it here.

Migrating from Fleek.co to Fleek-platform CLI

Users migrating from Fleek.co should adapt their setup to use the Fleek Platform instructions described here.

Alternatively, you can use the following as a reference to perform the required changes.

  1. Backup the original Fleek deploy yaml file.
git mv .github/workflows/deploy.yml .github/workflows/deploy.yml.bak

You can delete this file later. But keep it as a reference to move any customization to the new GitHub Action.

  1. Remove the secret FLEEK_API_KEY from GitHub’s repository secrets, read the documentation here

  2. Generate a new GitHub Action as instructed here

  3. Use the step 1’s backup file to copy any custom steps or commands onto the new GitHub Action file

Next, you can navigate to the GitHub’s Actions tab. Commit and push a change to your repository in order to trigger the Fleek CI to be executed.

You can access the Actions tab of you repository at https://github.com/<ORGANIZATION>/<REPOSITORY-NAME>, e.g. for the Fleek’s Website repository you’d access it here.

  1. When happy, feel free to delete the backup file
git rm .github/workflows/deploy.yml.bak