Giter Site home page Giter Site logo

pack-action's Introduction

test

Pack Github Action

This Github Action uses the Pack CLI (a product of the Cloud Native Buildpacks project) to build applications and associated artifacts, without a Dockerfile. For more about pack concepts, see the pack docs. For pack usage specific documentation, see the Pack CLI docs.

In v2, login is no longer included in the action. Instead, users should use the docker/login-action in another step beforehand, and this action should pick up those credentials

In v2, you must use the direct path within the directory, without the /github/workspace/ preface

Usage

Help

jobs:
  test:
    runs-on: linux
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pack Help
        uses: dfreilich/pack-action@v2
        with:
          args: help

Local Build

jobs:
  local_build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pack Build
        uses: dfreilich/pack-action@v2
        with:
          args: 'build test_img --builder paketobuildpacks/builder:full'

For a list of suggested builders, run:

$ pack suggest-builders

on your local machine.

Remote Build

  dockerhub_remote_build:
    runs-on: ubuntu-latest
    env:
      USERNAME: '<SOMETHING>'
      IMG_NAME: '<SOME_IMG>'
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set App Name
        run: 'echo "IMG_NAME=$(echo ${USERNAME})/$(echo ${IMG_NAME})" >> $GITHUB_ENV'
      - name: login
        uses: docker/login-action@v1
        with:
          username: ${{ env.USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}
      - name: Pack Remote Build
        uses: dfreilich/pack-action@v2
        with:
          args: 'build ${{ env.IMG_NAME }} --builder paketobuildpacks/builder:full --publish'

If you are publishing to a registry that is not Docker Hub, you can also add in an optional registry argument:

  github_registry_remote_build:
    runs-on: ubuntu-latest
    env:
      USERNAME: '<NAME>'
      IMG_NAME: '<IMAGE>'
      REGISTRY: '<REGISTRY: ex. ghcr.io>'
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set App Name
        run: 'echo "IMG_NAME=$(echo ${REGISTRY})/$(echo ${USERNAME})/$(echo ${IMG_NAME})" >> $GITHUB_ENV'
      - id: login
        uses: docker/login-action@v1
        with:
          username: ${{ env.USERNAME }}
          password: ${{ secrets.GH_PACKAGES_PAT }}
          registry: ${{ env.REGISTRY }}
      - name: Pack Remote Build
        uses: dfreilich/pack-action@v2
        with:
          args: 'build ${{ env.IMG_NAME }} --builder ${{ env.BUILDER }} --publish'

More Examples

For more examples, see the test workflows.

Inputs

args

Required The arguments to pass into pack. A list of available commands can be found here.

How can I help ?

Any contribution is welcome! The most basic way to show your support is to star ๐ŸŒŸ the project, or to raise issues ๐Ÿ’ฌ.

License

Apache. See LICENSE for more details.

pack-action's People

Contributors

dependabot[bot] avatar dfreilich avatar github-actions[bot] avatar jromero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pack-action's Issues

nodejs build failing

Hi,
I am trying to run a nodejs build but seems the builder does not recognize the app. I am able to see that package.json exists in the path.

ERROR: failed to detect: no buildpacks participating
ERROR: failed to build: executing lifecycle: failed with status code: 100

https://pipelines.actions.githubusercontent.com/FLYOaUfiaGidt873VR3GDWc692yEa2NHVimE5wXpR1dGwZrD9U/_apis/pipelines/1/runs/1/signedlogcontent/3?urlExpires=2021-04-01T20%3A57%3A01.8031334Z&urlSigningMethod=HMACV1&urlSignature=qKtoVbnpIZxLc%2BP68OLs47X3lMeILi3HcVXGp0YpfOQ%3D

Action is not executable

In buildpacks/pack which uses this action, recently received the following error:

standard_init_linux.go:219: exec user process caused: no such file or directory

After some investigation, I was able to determine that:

  • It was due to entrypoint.sh not being executable.
    • Cause: the base image buildpacksio/pack is pointing to a mutable tag and the latest version no longer includes /bin/sh.
      • Cause: /bin/sh is no longer present due to now being build by the paketo tiny builder

Proposal

  1. Tagged versions of the action should be using an immutable tag or image sha as the base.
  2. No entrypoint.sh should be necessary if we can solve not needing to pass auth.
  3. If entrypoint.sh is necessary, something like busybox can be used to augment the base build.

Pin Action to pack version

An update to Pack broke the action, which shouldn't happen. Pin releases to specific versions, and set up automation to update the action as the buildpacksio/pack image is updated, with tests to ensure that it works.

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.