script

package module
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 5 Imported by: 0

README

Github Action Script.go

This little GitHub action lets you write the rest of your deployment script in Go. Behind the scenes, it creates a plugin out of your Go code and executes it.

example of using this Github Action

name: Example
on:
  push:
    branches:
      - "main"

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Setup Go 1.18
        uses: actions/setup-go@v2
        with:
          go-version: ^1.18

      - name: Checking out ...
        uses: actions/checkout@v2

      - name: Scripts
        uses: alinz/script.go@main
        with:
          workspace: ${{ github.workspace }} # <- this is important
          paths: .github/workflows/one,.github/workflows/two #<- the path to your go scripts

make sure to pass your workspace folder. Also each go script must be placed inside a unique folder and must have a go.mod file. For a real example, checkout this repo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.2.0

type Config struct {
	User             string
	Host             string
	Port             int
	PrivateKeyEnv    string
	DefaultLocalPath string
}

type Runner added in v1.2.0

type Runner interface {
	ssh.Runner
	RunLocal(workspace string, cmds ...string) error
}

func NewRunner added in v1.2.0

func NewRunner(config *Config) (Runner, error)

Directories

Path Synopsis
cmd
pkg
ssh

Jump to

Keyboard shortcuts

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