Skip to content

Commit

Permalink
Added Github action deployment doc (#27)
Browse files Browse the repository at this point in the history
* Github Deploy action

* Added meta name
  • Loading branch information
dmick92 authored Jul 17, 2024
1 parent 84fe23c commit 67c46ea
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/catalyst/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"display": "hidden"
},
"nextJsSetup": "Catalyst and NextJS Setup",
"formatDateTimeForDataStore": "Format DateTime For DataStore (NodeJS)"
"formatDateTimeForDataStore": "Format DateTime For DataStore (NodeJS)",
"githubActionDelpoy": "Deploy Via GitHub Actions"
}
77 changes: 77 additions & 0 deletions pages/catalyst/githubActionDelpoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Deploy Via GitHub Actions
description: Deploy functions and client GitHub Actions.
---

# Deploy Via GitHub Actions

Deploy functions and client GitHub Actions.

## Prerequisites:

- Generate a [Catalyst CLI token](https://docs.catalyst.zoho.com/en/cli/v1/working-with-tokens/generate-token/) and add it to your GitHub repository as a secret.
- Create a [GitHub Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) named `CATALYST_TOKEN` with the above Catalyst token.

## Optional:

You can remove the `--verbose` flag from the catalyst deploy command to hide the output logs.

## YAML Script:

```yaml
name: Deploy

on:
push:
branches:
- main # Trigger only on pushes to the main branch. Change to your branch name.

env:
PROJECT_ID: "REPLACE_WITH_YOUR_PROJECT_ID" # Catalyst project ID
NODE_VERSION: "18"

jobs:
deploy_functions:
name: Deploy Functions
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js and Install Dependencies
id: setup-node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install zcatalyst-cli
run: npm install -g zcatalyst-cli

- name: Deploy Functions
env:
CATALYST_TOKEN: ${{ secrets.CATALYST_TOKEN }} # Requires catalyst token secret
run: catalyst deploy --only functions --project $PROJECT_ID --token $CATALYST_TOKEN --verbose

deploy_client:
name: Deploy Client
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js and Install Dependencies
id: setup-node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install zcatalyst-cli
run: npm install -g zcatalyst-cli

- name: Deploy Client
env:
CATALYST_TOKEN: ${{ secrets.CATALYST_TOKEN }} # Requires catalyst token secret
run: catalyst deploy --only client --project $PROJECT_ID --token $CATALYST_TOKEN --verbose
```

0 comments on commit 67c46ea

Please sign in to comment.