Skip to content

Commit

Permalink
Merge branch 'develop' into chore/pricing-table-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgaard authored Sep 27, 2024
2 parents bbadd15 + d4fb905 commit e556041
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/actions/spell-checker/ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ ru
ruby
russia
s3
saas
saml
sandbox
sanitizer
Expand Down Expand Up @@ -430,6 +431,7 @@ thursday’s
tld
tls
token
toolset
tooltip
tooltips
totp
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const SidebarMenu: FC<Props> = ({ data, pathname }) => {
? activeItemRef
: null
}
className={`inline-block w-full font-plex-sans text-16 leading-loose text-gray-dark-11 transition duration-150 hover:opacity-100 ${
className={`inline-block w-full font-plex-sans text-16 capitalize leading-loose text-gray-dark-11 transition duration-150 hover:opacity-100 ${
isActiveSlug(item.slug) && isActiveCategory(item.category)
? `${activeItemStyle}`
: 'opacity-80'
Expand Down
89 changes: 89 additions & 0 deletions src/content/docs/CLI/GitHub Actions/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
order: 10
title: GitHub Actions
date: 2023-01-10
desc: Create a GitHub Action for deploying a Fleek Site
keywords: [services, documentation, getting started]
tags:
- CLI
- Guide
- Learn
- Fleek
- GitHub
- CI/CD
---

# GitHub Actions

Use custom GitHub Actions to deploy your site to Fleek instead of using the CLI's [Site deploy](/docs/cli/sites#deploy-a-site) command. This approach is suitable if you have an existing repository that you want to deploy on [Fleek Platform](https://fleek.xyz).

The Fleek-platform CLI can generate a GitHub Action (yaml) for deploying a [Fleek Site](/docs/cli/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](/docs/cli/sites#initialize-the-fleek-site), if you haven't done already you can learn about it [here](/docs/cli/sites#initialize-the-fleek-site).

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

```sh
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.

```sh
.github/workflows/fleek-deploy.yaml
```

### Configure the GitHub repository settings

On [Create a GitHub Action](#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](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).

Here's an example:

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

:::note
You can create your own GitHub Action with any necessary customizations; The Fleek-platform CLI's generated GitHub Action provides a starting point for deploying your site to Fleek.
:::

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](https://github.com/fleek-platform/website) you'd access it [here](https://github.com/fleek-platform/website/actions).

### 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](#create-a-github-action-for-fleek-sites-deployment).

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

1. Backup the original Fleek deploy yaml file.

```sh
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.

2. Remove the secret `FLEEK_API_KEY` from GitHub's repository secrets, read the documentation [here](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions)

3. Generate a new GitHub Action as instructed [here](#create-a-github-action-for-fleek-sites-deployment)

4. 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](https://github.com/fleek-platform/website) you'd access it [here](https://github.com/fleek-platform/website/actions).

5. When happy, feel free to delete the backup file

```sh
git rm .github/workflows/deploy.yml.bak
```
52 changes: 52 additions & 0 deletions src/content/docs/CLI/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ The Fleek Platform CLI is a command-line interface, that lets users interact wit

In the next steps, we’re going to install the CLI, create a project and deploy a simple page.

:::warn
Fleek.co users migrating to the new Fleek Platform, please check the [migrating from Fleek.co to Fleek-platform CLI](#migrating-from-fleekco-to-fleek-platform-cli) section.
:::

## Install

To install the CLI launch your terminal and run:
Expand Down Expand Up @@ -190,3 +194,51 @@ fleek logout
```
✅ Successfully logged out.
```
## Migrating from Fleek.co to Fleek-platform CLI
The Fleek.co's [CLI](https://www.npmjs.com/package/@fleekhq/cli) features are part of Fleek Platform CLI, which brings enhanced performance, new features, and broader support for all your development needs.

If you use [Fleek CLI](https://www.npmjs.com/package/@fleekhq/cli) to interact with Fleek.co's Services, migrate to the Fleek Platform, familiarizing yourself with the following changes or consult our [CLI docs](/docs/cli) for a deep dive.
### Global installation
The CLI global installation process has changed.
:::warn
To avoid conflicts, uninstall the deprecated `@fleekhq/fleek-cli` package before installing the new Fleek Platform CLI. This will free up the fleek command for use with the new version.
:::
```sh
# Old install command
npm install -g @fleekhq/fleek-cli
# New install command
npm install -g @fleek-platform/cli
```
Learn more by reading the CLI documentation [here](/docs/cli).
### Sites Init & Deploy
Initializing and deploying a static site has changed. To initialize a Fleek site:
```sh
# Old site init command
fleek site:init
# New site init command
fleek sites init
```
To deploy the Fleek site:
```sh
# Old site deploy command
fleek site:deploy
# New site deploy command
fleek sites deploy
```
You can learn about other Sites service features [here](docs/cli/sites).
100 changes: 100 additions & 0 deletions src/content/docs/SDK/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ tags:

The Fleek Platform SDK is a TypeScript library that allows you to interact with Fleek’s services. It’s composed of methods that you can leverage to build your own application on top of Fleek’s services.

:::warn
Fleek.co users migrating to the new Fleek Platform, please check the [migrating from Fleek.co to Fleek-platform SDK](#migrating-from-fleekco-to-fleek-platform-sdk) section.
:::

## Install

The SDK is available as an NPM package.
Expand Down Expand Up @@ -129,3 +133,99 @@ const fleekSdk = new FleekSdk({
accessTokenService: applicationService
});
```

## Migrating from Fleek.co to Fleek Platform SDK

The Fleek.co's [SDK](https://www.npmjs.com/package/@fleekhq/sdk) and [Storage](https://www.npmjs.com/package/@fleekhq/fleek-storage-js) features are part of Fleek Platform SDK, which brings enhanced performance, new features, and broader support for all your development needs.

Learn how to migrate to Fleek Platform with these steps or consult our [SDK docs](/docs/sdk) for a deep dive.

### Fleek Storage JS

If you use [Fleek Storage Js](https://www.npmjs.com/package/@fleekhq/fleek-storage-js) to interact with Fleek Storage, migrate to the Fleek Platform, implementing the following changes:

```js
# Old syntax
import { Fleek } from '@fleekhq/sdk';

const sdk = new Fleek({
apiKey: '<YOUR-API-KEY>',
assetCanisterId: '<YOUR-ASSET-CANISTER-ID>',
});
```

```js
# New syntax
import { FleekSdk, ApplicationAccessTokenService } from '@fleek-platform/sdk';

# Using the Application Token
# Learn more about the available token services
# by following the link below
const applicationService = new ApplicationAccessTokenService({
clientId: <APPLICATION-CLIENT-ID>,
});

const fleekSdk = new FleekSdk({
accessTokenService: applicationService
});
```

Learn more by reading the SDK documentation [here](/docs/sdk).

### Fleek.co's SDK

If you use [Fleek.co's SDK](https://www.npmjs.com/package/@fleekhq/sdk) to interact with Fleek APIs and Internet Computer, migrate to the Fleek Platform, implementing the following changes:

```js
# Old syntax
import { Fleek } from '@fleekhq/sdk';

const sdk = new Fleek({
apiKey: '<YOUR-API-KEY>',
assetCanisterId: '<YOUR-ASSET-CANISTER-ID>',
});

# Using IPFS
await sdk.ipfs().add(...);
```

```js
# New syntax
import { FleekSdk, ApplicationAccessTokenService } from '@fleek-platform/sdk';

# Using the Application token service
# Learn more about the available token services
# by following the link below
const applicationService = new ApplicationAccessTokenService({
clientId: <APPLICATION-CLIENT-ID>,
});

const fleekSdk = new FleekSdk({
accessTokenService: applicationService
});

# Using Storage
# It'll default to IPFS
const result = await fleekSdk.storage().uploadFile({
file,
onUploadProgress,
});
```
Support for Internet Computer asset canister has been deprecated. You must use the Fleek Platform [Storage](/docs/sdk/storage), which includes similar methods as follows:
```js
# Deprecated feature
const items = await sdk.assets().listAll();
const item = await sdk.assets().get(key);
```
```js
# Storage feature
const items = await fleekSdk.storage().list();
# Get by CID
const item = await fleekSdk.storage().get({ cid });
```
Learn more about [Storage](/docs/sdk/storage) and feature coverage by reading the SDK's Storage documentation [here](/docs/sdk/storage).

0 comments on commit e556041

Please sign in to comment.