A GitHub Action to automate GlassFlow pipeline deployments as code.
This GitHub Action enables you to:
- Track Changes in Your Pipelines: Detect changes in
*.yaml
,*.py
, andrequirements.txt
files since the last commit (via Changed Files Action). - Create Spaces: Assign pipelines to new spaces by omitting
space_id
and specifyingspace_name
. The action will create a space with the given name and update the YAML file with the assignedspace_id
. - Create Pipelines: New pipelines without an assigned
pipeline_id
(empty or missingpipeline_id
key) will be created, and the YAML file will be updated with the assigned ID. - Update Pipelines: Changes to pipeline YAML files,
requirements.txt
, or linked Python files will be pushed to GlassFlow. - Delete Pipelines: If a pipeline's YAML file is deleted, the corresponding pipeline will be deleted from GlassFlow.
To use this action, configure your repository with a GlassFlow Personal Access Token:
- Go to your repository's Settings > Secrets and variables > Actions.
- Add a new secret named GlassFlowPAT (or any name you prefer).
- Set the value to your GlassFlow Personal Access Token, which can be found on your GlassFlow profile page.
GitHub encrypts your token, and the action will not expose it in logs.
Below is an example GitHub Actions workflow to push pipelines to GlassFlow on every push to the main
branch:
name: Push to GlassFlow
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: glassflow/pipelines-push-action@v1
with:
glassflow-personal-access-token: ${{ secrets.GlassFlowPAT }}
Name | Required | Description |
---|---|---|
glassflow-personal-access-token |
✅ | GlassFlow Personal Access Token (stored in GitHub Secrets). |
pipelines-dir |
❌ | Directory containing pipelines (Default: 'pipelines' ). |
dry-run |
❌ | If 'true' , changes will not be pushed to GlassFlow (Default: 'false' ). |
Output | Description |
---|---|
to-create-count |
Number of new pipelines to create. |
to-create-ids |
Pipeline IDs created (available only if dry-run is false ). |
to-update-count |
Number of pipelines to update. |
to-update-ids |
Pipeline IDs updated. |
to-delete-count |
Number of pipelines to delete. |
to-delete-ids |
Pipeline IDs deleted. |
space-to-create-count |
Number of spaces to be created. |
spaces-to-create-ids |
Space IDs created. |
- What happens if a pipeline was deleted from the Web App, but its YAML file is modified?
- The action will fail because the
pipeline_id
in the YAML file no longer exists in GlassFlow.
- The action will fail because the
- What happens if I update a pipeline in the Web App?
- This action syncs changes from YAML to GlassFlow only. Updates made in the web app may be overwritten when changes are pushed from the YAML, handler, or
requirements.txt
files.
- This action syncs changes from YAML to GlassFlow only. Updates made in the web app may be overwritten when changes are pushed from the YAML, handler, or
This action provides a streamlined way to manage your GlassFlow pipelines as code, ensuring consistency and automation in your deployment process.