Skip to content

Commit

Permalink
Tidy up documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmclaugh committed Sep 10, 2024
1 parent 24e8a95 commit e39118f
Showing 1 changed file with 37 additions and 12 deletions.
49 changes: 37 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ The `gha-setup-workspace` action performs the following tasks:
* Downloads the artifact if checkout_artifact is `true`
* .

## Inputs
## Usage
See below for inputs, outputs, and examples.

### Inputs

- `artifact_name_override` (optional): Override the name of the artifact to use. Default is an empty string which determines the artifact name automatically.
- `checkout_artifact` (optional): Whether to checkout artifact instead of source. Value must be `true` or `false`.
Expand All @@ -24,7 +27,7 @@ The `gha-setup-workspace` action performs the following tasks:
- `is-artifact`: Checkout type is artifact.
- `is-source`: Checkout type is source.

## Usage
### Examples

To use this action, add the following step to your workflow:

Expand All @@ -42,31 +45,53 @@ jobs:

deploy:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Setup job workspace
uses: ServerlessOpsIO/gha-setup-workspace@v1
with:
checkout_artifact: true
```
### Artifact naming
### Configuration
See below for extended information on certain configuration.
#### Artifact naming
Both [ServerlessOpsIO/gha-setup-workspace](https://github.com/ServerlessOpsIO/gha-setup-workspace) and [ServerlessOpsIO/gha-store-artifacts](https://github.com/ServerlessOpsIO/gha-store-artifacts) use the same [utility action](https://github.com/ServerlessOpsIO/gha-artifact-name) to set an artifact name if `artifact_name_override` is not set. If your workflow sets _artifact_name_override_ for `ServerlessOpsIO/gha-setup-workspace` be sure to use that actions _artifact_name_ output to set _artifact_name_override_ for `ServerlessOpsIO/gha-store-artifacts`.

See the example below:

```yaml
- name: Setup job workspace
id: setup-workspace
uses: ServerlessOpsIO/gha-setup-workspace@v1
with:
artifact_name_override: 'my-artifact'
outputs:
artifact_name:
description: The name of the artifact downloaded.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup job workspace
uses: ServerlessOpsIO/gha-setup-workspace@v1
- name: Store Artifacts
uses: ServerlessOpsIO/gha-store-artifacts@v1
with:
artifact_name_override: 'MyArtifactName'
outputs:
artifact-name: ${{ steps.setup-workspace.outputs.artifact-name }}
deploy:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Setup job workspace
uses: ServerlessOpsIO/gha-setup-workspace@v1
with:
checkout_artifact: true
artifact_name_override: ${{ needs.build.outputs.artifact-name }}
- name: Store Artifacts
uses: ServerlessOpsIO/gha-store-artifacts@v1
with:
artifact_name_override: '${{ steps.setup-workspace.outputs.artifact_name }}'
```

## Contributing
Expand Down

0 comments on commit e39118f

Please sign in to comment.