Skip to content

jamesward/pklgha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pkl GitHub Actions

Check out the PklDoc

GitHub Action in Pkl

.github/workflows/hello.pkl

amends "package:https://pkg.pkl-lang.org/github.com/jamesward/pklgha/[email protected]#/GitHubAction.pkl"

on {
  push {

  }
}

jobs {
  ["hello"] = new {
    `runs-on` = "ubuntu-latest"

    steps {
      new {
        name = "checkout"
        uses = "actions/checkout@v4"
      }
    }
  }
}

Generate the Yaml:

pkl eval -f yaml -o .github/workflows/hello.yaml .github/workflows/hello.pkl

Examples

Release a Pkl Package

  1. Enable publishing GitHub Pages from GitHub Actions via https://github.com/<your org>/<your repo>/settings/pages
  2. Create .github/workflows/release.pkl
    amends "package:https://pkg.pkl-lang.org/github.com/jamesward/pklgha/[email protected]#/GitHubActionPkl.pkl"
    
    action = "release"
    
  3. Create the GitHub Action Yaml:
    pkl eval -f yaml -o .github/workflows/release.yaml .github/workflows/release.pkl
    

Developer Info

Update

pkl eval -f yaml -o .github/workflows/release.yaml .github/workflows/release.pkl

Release

  1. Update the version above
  2. Tag and push
    git tag [email protected]
    git push --atomic origin main [email protected]