GitHub Action
Setup HashiCorp Nomad
The hashicorp/setup-nomad
Action sets up the Nomad CLI in your GitHub Actions workflow by adding the nomad
binary to PATH
.
This GitHub Actions supports all commands that are available in the nomad
CLI.
Specific nomad
commands may require access to provider-specific credentials.
Create a GitHub Actions Workflow file (e.g.: .github/workflows/nomad.yml
):
name: nomad
on:
push:
env:
PRODUCT_VERSION: "1.8.0" # or: "latest"
jobs:
nomad:
runs-on: ubuntu-latest
name: Run Nomad
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup `nomad`
uses: hashicorp/setup-nomad@main
id: setup
with:
version: ${{ env.PRODUCT_VERSION }}
- name: Run `nomad version`
id: version
run: "nomad version"
In the above example, the following definitions have been set.
- The event trigger has been set to
push
. For a complete list, see Events that trigger workflows. - The origin of this GitHub Action has been set as
hashicorp/setup-nomad@main
. For newer versions, see the Releases. - The version of
nomad
to set up has been set as1.8.0
. For a complete list, see releases.hashicorp.com.
These definitions may require updating to suit your deployment, such as specifying self-hosted runners.
Additionally, you may configure outputs to consume return values from the Action's operations.
This section contains a list of all inputs that may be set for this Action.
version
- (required) The version ofnomad
to install. Defaults tolatest
if unset.
Note
To retrieve the latest
version, this GitHub Action polls the HashiCorp Releases API and finds the latest released version of Nomad that isn't marked as a pre-release (is_prerelease
).
This section contains a list of all outputs that can be consumed from this Action.
version
- The version ofnomad
that was installed.
This GitHub Action is maintained by the contributors listed on GitHub.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, without WARRANTIES or conditions of any kind, either express or implied.
See the License for the specific language governing permissions and limitations under the License.