CI/CD - Github Actions
Linking environment to Livecycle using GH Actions
After setting up Livecycle's SDK, you'll need to link your preview environments to Livecycle.
If you're using GH actions, that can be easily done via Livecycle CLI and an API Key.
To generate API Key, go to "Api Keys" tab under settings menu in dashboard.
name: CI-Preview-Job-Example
on:
push:
jobs:
preview-environment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.5.0
- id: preview
uses:
# some logic for creating preview environment and store the url
- name: link environment to livecycle
env:
LIVECYCLE_API_KEY: ${{ github.secrets.LC_API_KEY }} #Livecycle API-Key should be stored as secret
PREVIEW_URL: ${{ steps.preview.outputs.value }}
run: npx @livecycle/cli link --url=$PREVIEW_URL --from-git=. --api-key=$LIVECYCLE_API_KEY