GithubHelp home page GithubHelp logo

omnictl-action's Introduction

omnictl GitHub Action

This repository enables running general omnictl commands as GitHub Actions. Use this action to manage Sidero Omni resources as part of a GitOps workflow or CI/CD pipeline.

Configuration

Setup

Before using this action, you must create an Omni service account to authenticate with Sidero Omni. See https://omni.siderolabs.com/docs/how-to-guides/how-to-create-a-service-account/ for more information about creating a service account.

Once the service account is created, it is recommended to save the endpoint and service account key as repository secrets (Settings > Secrets and variables > Actions). The below examples assume these values are saved as OMNI_ENDPOINT and OMNI_SERVICE_ACCOUNT_KEY, respectively.

Inputs

Required inputs

Name Description
omni-endpoint The Omni endpoint URL generated for your service account. See https://omni.siderolabs.com/docs/how-to-guides/how-to-create-a-service-account/ for more information about creating a service account.
omni-service-account-key The Omni service account key generated for your service account. See https://omni.siderolabs.com/docs/how-to-guides/how-to-create-a-service-account/ for more information about creating a service account.
command The omnictl command to run. See https://omni.siderolabs.com/docs/reference/cli/ for a full list of omnictl commands and parameters.

Defaults to omnictl --version.

Optional inputs

Name Description
working-directory The working directory from which to execute the command.

This is useful for operations that are sensitive to file context such as relative paths in resource templates. The value should be relative to the "current directory" (./) of your GitHub Actions job. Note that the current directory is usually the root directory of your cloned repository if used in conjunction with actions/checkout.

Defaults to ./.

Examples

Validate a cluster template

on:
  push:
    branches:
      - main
    paths:
      - 'path/to/cluster/resources/**'

jobs:
  validate:
    runs-on: ubuntu-latest
    name: Validate cluster templates
    steps:
      - name: Checkout cluster templates
        uses: actions/checkout@v4

      - name: Run omnictl
        uses: jdmcmahan/omnictl-action@v1
        with:
          working-directory: ./path/to/cluster/resources/
          omni-endpoint: ${{ secrets.OMNI_ENDPOINT }}
          omni-service-account-key: ${{ secrets.OMNI_SERVICE_ACCOUNT_KEY }}
          command: omnictl cluster template -f cluster.yaml validate

Sync a cluster template with Omni

on:
  push:
    branches:
      - main
    paths:
      - 'path/to/cluster/resources/**'

jobs:
  sync:
    runs-on: ubuntu-latest
    name: Sync cluster templates with Sidero Omni
    steps:
      - name: Checkout cluster templates
        uses: actions/checkout@v4

      - name: Run omnictl
        uses: jdmcmahan/omnictl-action@v1
        with:
          working-directory: ./path/to/cluster/resources/
          omni-endpoint: ${{ secrets.OMNI_ENDPOINT }}
          omni-service-account-key: ${{ secrets.OMNI_SERVICE_ACCOUNT_KEY }}
          command: omnictl cluster template -f cluster.yaml sync --verbose

Create or update a resource directly

on:
  push:
    branches:
      - main
    paths:
      - 'path/to/cluster/resources/**'

jobs:
  apply:
    runs-on: ubuntu-latest
    name: Create or update a super important Omni resource
    steps:
      - name: Checkout cluster templates
        uses: actions/checkout@v4

      - name: Run omnictl
        uses: jdmcmahan/omnictl-action@v1
        with:
          working-directory: ./path/to/cluster/resources/
          omni-endpoint: ${{ secrets.OMNI_ENDPOINT }}
          omni-service-account-key: ${{ secrets.OMNI_SERVICE_ACCOUNT_KEY }}
          command: omnictl apply -f resource.yaml --verbose

omnictl-action's People

Contributors

jdmcmahan avatar renovate[bot] avatar

Stargazers

David Demlow avatar

Watchers

 avatar

omnictl-action's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/checkout v4
  • thenativeweb/get-next-version 2.6.2
  • softprops/action-gh-release v2
regex
action.yml
  • mcmahan/omnictl 0.39.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.