Skip to content

Commit

Permalink
adding workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Mack committed Jun 10, 2024
1 parent 41290e5 commit c783cd5
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/devcontainer-feature-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: spacefx-dev-build-publish

on:
workflow_dispatch:
push:
branches:
- km/add_dev_container_feature

env:
REGISTRY: ghcr.io
FEATURE: microsoft/azure-orbital-space-sdk/spacefx-dev
ARTIFACT_PATH: ./output/spacefx-dev/devcontainer-feature-spacefx-dev.tgz

jobs:
build-publish-feature:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/initialize@main
with:
env_file: ./env/spacefx.env
token: ${{ secrets.GITHUB_TOKEN }}

- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-oras@main
with:
oras_version: 0.16.0

- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-devcontainer-cli@main

- name: Build and publish devcontainer feature
shell: bash
run: |
echo "Sourcing environment variables..."
source ./env/spacefx.env
# Validate the output directory exists and clean it out if there is content already present
echo "Creating output directory..."
mkdir -p "./output/spacefx-dev"
# Copy the scripts ino the entry point for the devcontainer feature
echo "Copying all files to /var/spacedev..."
./.vscode/copy_to_spacedev.sh --output_dir ./.devcontainer/features/spacefx-dev/azure-orbital-space-sdk-setup
# Build the devcontainer feature
echo "Building the devcontainer feature..."
devcontainer features package --force-clean-output-folder ./.devcontainer/features --output-folder ./output/spacefx-dev
# Push the devcontainer feature tarball to the registry
echo "Pushing the devcontainer feature tarball to the registry..."
oras push ${{ env.REGISTRY }}/${{ env.FEATURE }}:${SPACEFX_VERSION} \
--config /dev/null:application/vnd.devcontainers \
--annotation org.opencontainers.image.source=https://github.com/microsoft/azure-orbital-space-sdk-setup \
${{ env.ARTIFACT_PATH }}:application/vnd.devcontainers.layer.v1+tar

0 comments on commit c783cd5

Please sign in to comment.