Skip to content

Commit

Permalink
Publish recipe examples
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Nov 12, 2023
1 parent 0af965a commit fbb5670
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
- docs
paths:
- ".github/workflows/deploy-docs.yaml"
- ".github/workflows/deploy-docs.yml"
- "docs/**"
- "internal/cli/**"

Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/publish-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish recipe examples

on:
push:
branches:
- main
paths:
- ".github/workflows/publish-examples.yml"
- "examples/**"

jobs:
publish:
name: Publish example recipes
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3

- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-go@v3
with:
go-version: "1.21"

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }} # https://github.com/arduino/setup-task#repo-token

- name: Push example recipes to GitHub Packages
run: |
for dir in examples/*/ # list directories in the form "examples/dirname/"
do
dir=${dir%*/} # remove the trailing "/"
task run -- validate ${dir}
task run -- push ${dir} oci://ghcr.io/futurice/jalapeno/${dir}
done
6 changes: 6 additions & 0 deletions docs/site/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ mkdir my-project
jalapeno execute my-recipe -d my-project
```

You can also execute any of the examples from the Jalapeno repository, for example:

```bash
jalapeno execute oci://ghcr.io/futurice/jalapeno/examples/variable-types:0.0.0 -d my-project
```

After this, the project directory should have the following files:

```
Expand Down

0 comments on commit fbb5670

Please sign in to comment.