Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/earthly/actions-setup
https://github.com/earthly/actions-setup
Last synced: about 12 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/earthly/actions-setup
- Owner: earthly
- Created: 2022-03-10T20:01:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T08:00:45.000Z (3 months ago)
- Last Synced: 2024-11-03T15:41:52.522Z (11 days ago)
- Language: TypeScript
- Size: 9.05 MB
- Stars: 22
- Watchers: 4
- Forks: 8
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Setup Earthly - GitHub Action
This repository contains an action for use with GitHub Actions, which installs [earthly](https://github.com/earthly/earthly) with a semver-compatible version.
The package is installed into `/home/runner/.earthly` (or equivalent on Windows) and the `bin` subdirectory is added to the PATH.
## Usage
Full example:
```yml
name: GitHub Actions CIon:
push:
branches: [main]
pull_request:
branches: [main]jobs:
tests:
name: example earthly test
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest" # or pin to an specific version, e.g. "0.8.1"
- uses: actions/checkout@v2
- name: Docker login # to avoid dockerhub rate-limiting
run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: what version is installed?
run: earthly --version
- name: run the earthly hello world
run: earthly github.com/earthly/hello-world:main+hello
```Install the latest version of earthly:
```yaml
- name: Install earthly
uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```Install a specific version of earthly:
```yaml
- name: Install earthly
uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: 0.8.1
```Install a version that adheres to a semver range
```yaml
- name: Install earthly
uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ^0.8.0
```### Testing
You can perform a local test by running `earthly +all`.
It is also possible to use [act](https://github.com/nektos/act) to test the contents of the github actions config.
## Configuration
The action can be configured with the following arguments:
- `version` - The version of earthly to install. Default is `latest`. Accepts semver style values.
- `prerelease` (optional) - allow prerelease versions.
- `use-cache` (optional) - whether to use the cache to store earthly or not.
- `github-token` (optional) - GitHub token for fetching earthly version list. Recommended to avoid GitHub API ratelimit.