-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
13,483 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
earthfiles: | ||
description: | | ||
A JSON list of Earthfile paths+targets to use for publishing | ||
required: true | ||
type: string | ||
forge_version: | ||
description: | | ||
The version of the forge CLI to install (use 'local' for testing) | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
run: | ||
name: ${{ matrix.earthfile }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
earthfile: ${{ fromJson(inputs.earthfiles) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup CI | ||
uses: ./forge/actions/setup | ||
with: | ||
forge_version: ${{ inputs.forge_version }} | ||
- name: Run | ||
id: run | ||
uses: ./forge/actions/run | ||
with: | ||
path: ${{ matrix.earthfile }} | ||
- name: Get image | ||
id: image | ||
run: | | ||
INPUT="${{ matrix.earthfile }}" | ||
EARTHFILE="${INPUT%+*}" | ||
TARGET="${INPUT#*+}" | ||
echo "EARTHFILE: $EARTHFILE" | ||
echo "TARGET: $TARGET" | ||
$RESULT="${{ steps.run.outputs.result }}" | ||
$IMAGE=$(echo "$RESULT" | jq -r ".images[\"$TARGET\"]") | ||
if [[ "$IMAGE" == "null" ]]; then | ||
echo "::error file=${EARTHFILE}/Earthfile::No images produced. Cannot publish." | ||
exit 1 | ||
fi | ||
echo "image=$IMAGE" >> $GITHUB_OUTPUT | ||
- name: Show image | ||
run: echo "${{ steps.image.outputs.image }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,6 @@ global: { | |
|
||
github: registry: "ghcr.io" | ||
} | ||
tagging: strategy: "commit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Discover Action | ||
|
||
The discover action acts as a wrapper over the `forge scan` command from the Forge CLI. | ||
It provides inputs that map to their respective flags. | ||
The result from running the command is returned in the `result` output. | ||
By default, the `--enumerate` flag is passed as this is usually the desired output format in CI. | ||
|
||
For more information on the `scan` command, refer to the Forge CLI documentation. | ||
|
||
## Usage | ||
|
||
```yaml | ||
name: Run Setup | ||
on: | ||
push: | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup | ||
uses: input-output-hk/catalyst-forge/forge/actions/setup@master | ||
- name: Discover | ||
id: discovery | ||
uses: input-output-hk/catalyst-forge/forge/actions/discover@master | ||
with: | ||
filters: | | ||
^check.* | ||
^test.* | ||
- name: Show result | ||
run: echo "${{ steps.discovery.outputs.result }} | ||
``` | ||
## Inputs | ||
| Name | Description | Required | Default | | ||
| --------- | --------------------------------------------- | -------- | --------- | | ||
| absolute | Output absolute paths | No | `"false"` | | ||
| enumerate | Enumerate results into Earthfile+Target pairs | No | `"true"` | | ||
| filters | A newline separated list of filters to apply | No | `""` | | ||
| path | The path to search from | No | `"."` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Publish | ||
description: Publish container images | ||
inputs: | ||
project: | ||
description: The path to the project | ||
required: true | ||
image: | ||
description: The full image name (name:tag) to publish | ||
required: true | ||
|
||
runs: | ||
using: node20 | ||
main: dist/index.js |
Oops, something went wrong.