Code Monkey home page Code Monkey logo

publish-feature's Introduction

Publish Dev Container Feature

๐Ÿ’ป Publish a single Dev Container Feature

1๏ธโƒฃ Publishes a single feature instead of a whole monorepo
๐Ÿค Works well with Dev Container Feature polyrepos
0๏ธโƒฃ Zero-config; sensible defaults

๐Ÿ‘€ Check out devcontainers-community/feature-starter for a template feature repo that uses this action.

Usage

GitHub Actions GitHub

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:

# publish-feature.yml
name: Publish feature
on:
  release:
    types: published
  workflow_dispatch:
concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: true
jobs:
  permissions:
    contents: read
    packages: write
  publish-feature:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: devcontainers-community/publish-feature@v1

This will publish the Dev Container Feature to your-username/features/id-of-your-feature and can be used like this:

// devcontainer.json
{
  "features": {
    "ghcr.io/octocat/my-features/my-feature": {}
  }
}

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

Deno

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.

publish-feature's People

Contributors

jcbhmr avatar njelich avatar

Watchers

 avatar

Forkers

njelich

publish-feature's Issues

Improve readme

  • add header image
  • add development blurb
  • shorten examples maybe use <details>
  • point to some real-world examples
  • add badges

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.