Skip to content

Commit

Permalink
fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Aug 15, 2023
1 parent 83bb1dd commit 12fb7b5
Showing 1 changed file with 48 additions and 42 deletions.
90 changes: 48 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

💻 Publish a **single** Devcontainer Feature

<div align="center">
<p align=center>
<img height=200 src=https://i.imgur.com/juxM8Xu.png>
</p>

<!-- TODO: Better header image -->
![](https://picsum.photos/600/400)
1️⃣ Publishes a **single** feature instead of a whole monorepo \
🤝 Works well with [Dev Container Feature polyrepos] \
0️⃣ Zero-config; sensible defaults

</div>

<!-- TODO: Add emoji bullet points -->
👀 Check out [devcontainers-community/feature-starter] for a template feature
repo that uses this action.

## Usage

![GitHub Actions](https://img.shields.io/static/v1?style=for-the-badge&message=GitHub+Actions&color=2088FF&logo=GitHub+Actions&logoColor=FFFFFF&label=)
![GitHub](https://img.shields.io/static/v1?style=for-the-badge&message=GitHub&color=181717&logo=GitHub&logoColor=FFFFFF&label=)

To get started, just create a new GitHub Repository that has a valid
`devcontainer-feature.json` manifest file and a working `install.sh` script.
Then add this to a GitHub Workflow like `.github/workflows/publish-feature.yml`:
Expand All @@ -38,40 +43,8 @@ jobs:
- uses: devcontainers-community/publish-feature@v1
```
```jsonc
// devcontainer.json
{
"features": {
"ghcr.io/octocat/my-feature": {}
}
}
```

```yml
# publish-feature.yml
name: Publish feature
on:
release:
types: published
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
publish-feature:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.MY_FATURES_GITHUB_TOKEN }}
- uses: devcontainers-community/publish-feature@v1
with:
# The '*' will be replaced with 'id' from 'devcontainer-feature.json'.
image: ghcr.io/octocat/my-features/*
```
This will publish the Dev Container Feature to
your-username/features/id-of-your-feature and can be used like this:
```jsonc
// devcontainer.json
Expand All @@ -84,8 +57,41 @@ jobs:

### Inputs

<!-- TODO: Describe inputs -->
- **`path`:** Where the `devcontainer-feature.json` manifest is located. The
default is `.`.

- **`files`:** Which files to include in the OCI published image. You can
specify a multiline list of glob patterns to include in the package. By
default this includes everything. The `README.md`, `LICENSE`, and
`devcontainer-feature.json` files will always be included in the generated
image.

- **`source`:** What to put for the `org.opencontainers.source` annotation on
the image. This defaults to the current GitHub repository using
`${{ github.server_url }}` and `${{ github.repository }}`.

- **`image`:** The destination image to push to. You can use a `*` which will be
replaced by the `id` field from the `devcontainer-feature.json` that was used.
By default this is `ghcr.io/${{ github.repository_owner }}/features/*`

- **`latest`:** A boolean flag to indicate whether or not to push to the
`:latest` tag of the image. By default this is `true`. Set this to `false` if
you're publishing an older version.

## Development

<!-- TODO: Provide development blurb -->
![Deno](https://img.shields.io/static/v1?style=for-the-badge&message=Deno&color=000000&logo=Deno&logoColor=FFFFFF&label=)

This GitHub Action is written using Deno. At some point in the future, it may be
transitioned to use plain Node.js. At present, though, we use a wrapper script
to download the self-contained `deno` binary locally and then run the `main.ts`
script.

To get started editing, fork this repo and make your changes. To test those
changes, push them to your own `main` branch or open a PR! We use GitHub
Actions-ception to test this Action using GitHub Actions.

<!-- prettier-ignore-start -->
[dev container feature polyrepos]: https://github.com/devcontainers-community/features
[devcontainers-community/feature-starter]: https://github.comm/devcontainers-community/feature-starter
<!-- prettier-ignore-end -->

0 comments on commit 12fb7b5

Please sign in to comment.