A GitHub Action that packages and deploys your Labspace.
This action:
- Sets up a known-working version of Docker Compose
- Creates a base64-encoded tarball of the content in the repository
- Generates a
.labspace/compose.pipeline.yamlfile with:- A
project_source_tarconfig containing the base64-encoded tarball - Mounts the tarball into the
configuratorservice and sets thePROJECT_TAR_PATHenvironment variable pointing to the mounted tarball
- A
- Publishes the Compose file using
docker compose publish
Your repository must have a .labspace/compose.overrides.yaml file, following the convention set in the dockersamples/labspace-starter repo.
| Input | Description | Required | Default |
|---|---|---|---|
target_repo |
The repo where the Compose file should be published | Yes | - |
target_tag |
The tag for the Compose file should be published | No | latest |
labspace_base_version |
The version of the base Labspace Compose file | No | latest |
labspace_override_files |
Paths to Labspace-specific Compose override files, comma separated | No | .labspace/compose.overrides.yaml |
name: Publish Labspace
on:
push:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Labspace
uses: dockersamples/publish-labspace-action@v1
with:
target_repo: dockersamples/labspace-demoThe action creates a Docker Compose override file that embeds your project source code as a base64-encoded tarball. This tarball is then available to the configurator service at runtime through the PROJECT_TAR_PATH environment variable.
The generated compose.pipeline.yaml structure:
configs:
project_source_tar:
content: |
<base64-encoded-tarball>
services:
configurator:
configs:
- source: project_source_tar
target: /etc/labspace-support/content.tar.base64
environment:
PROJECT_TAR_PATH: /etc/labspace-support/content.tar.base64