https://github.com/dfreilich/pack-action
A Github Action using the Pack CLI in your workflows
https://github.com/dfreilich/pack-action
buildpacks cloud-native-buildpacks cnb pack-cli
Last synced: about 1 month ago
JSON representation
A Github Action using the Pack CLI in your workflows
- Host: GitHub
- URL: https://github.com/dfreilich/pack-action
- Owner: dfreilich
- License: apache-2.0
- Created: 2020-08-14T19:12:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-20T23:56:55.000Z (about 2 years ago)
- Last Synced: 2024-04-17T20:10:40.012Z (about 1 year ago)
- Topics: buildpacks, cloud-native-buildpacks, cnb, pack-cli
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 12
- Watchers: 1
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Pack Github Action
This Github Action uses the [Pack CLI](https://github.com/buildpacks/pack) (a product of the [Cloud Native Buildpacks project](https://buildpacks.io)) to build applications and associated artifacts, without a Dockerfile. For more about pack concepts, see the [pack docs](https://buildpacks.io/docs). For `pack` usage specific documentation, see the [Pack CLI docs](https://buildpacks.io/docs/reference/pack/pack/).> In v2, login is no longer included in the action. Instead, users should use the [docker/login-action](https://github.com/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
```yaml
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
```yaml
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:
```shell script
$ pack suggest-builders
```
on your local machine.### Remote Build
```yaml
dockerhub_remote_build:
runs-on: ubuntu-latest
env:
USERNAME: ''
IMG_NAME: ''
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:
```yaml
github_registry_remote_build:
runs-on: ubuntu-latest
env:
USERNAME: ''
IMG_NAME: ''
REGISTRY: ''
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](.github/workflows/main.yml).## Inputs
### `args`
**Required** The arguments to pass into `pack`. A list of available commands can be found [here](https://buildpacks.io/docs/reference/pack/pack/).## How can I help ?
Any contribution is welcome! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:.## License
Apache. See [LICENSE](LICENSE) for more details.