github-action-workflow

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 2 Imported by: 0

README

codecov

github-action-workflow

GitHub Actions compatible workflows

Feature

  • Convert GitHub Workflows to Argo Workflows
  • Argo CD Config Management Plugin (CMP)

Usage

You can use it as a CLI:

gaw convert .github/workflows/pull-request.yaml

you can install it via hd:

hd i gaw

As CMP

This repository could be Config Management Plugin as well.

First, please patch argocd-repo-server with the following snippet:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: argocd-repo-server
  namespace: argocd
spec:
  template:
    spec:
      containers:
      - args:
        - --loglevel
        - debug
        command:
        - /var/run/argocd/argocd-cmp-server
        image: ghcr.io/linuxsuren/github-action-workflow:master
        imagePullPolicy: IfNotPresent
        name: tool
        resources: {}
        securityContext:
          runAsNonRoot: true
          runAsUser: 999
        volumeMounts:
        - mountPath: /var/run/argocd
          name: var-files
        - mountPath: /home/argocd/cmp-server/plugins
          name: plugins

then, create an Application on the Argo CD UI or CLI:

kind: Application
metadata:
  name: yaml-readme
  namespace: argocd
spec:
  destination:
    namespace: default
    server: https://kubernetes.default.svc
  project: default
  source:
    path: .github/workflows/                            # It will generate multiple Argo CD application manifests 
                                                        # base on YAML files from this directory.
                                                        # Please make sure the path ends with slash.
    plugin: {}                                          # Argo CD will choose the corresponding CMP automatically
    repoURL: https://gitee.com/linuxsuren/yaml-readme   # a sample project for discovering manifests
    targetRevision: HEAD
  syncPolicy:
    automated:
      selfHeal: true

Compatible

Considering GitHub Workflows has a complex syntax. Currently, we support the following ones:

  • Event filter
    • Support on.push and on.merge_request
  • keyword uses
    • support actions/checkout, actions/setup-go, goreleaser/goreleaser-action and docker://
  • keyword run
  • keyword env
  • concurrency
    • Not support cancel-in-progress yet

There are some limitations. For example, only the first job could be recognized in each file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL