/build-action

Github Action to run any into-docker builder image

Primary LanguageShellMIT LicenseMIT

into-docker/build-action

Spice Program Release CI

This is a Github Action to run Docker builds using the into-docker CLI tool.

Usage

Build

- uses: into-docker/build-action@v4
  with:
    image: target-image:latest
    builder: intodocker/clojure

# optional: push to docker registry
- run: >
    echo ${{ secrets.DOCKER_PASSWORD }} | \
      docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin && \
      docker push target-image:latest

Build + Caching

- uses: actions/cache@v2
  with:
    path: cache-file.tar
    key: ${{ runner.os }}-${{ hashFiles('project.clj') }}

- uses: into-docker/build-action@v4
  with:
    image: target-image:latest
    builder: intodocker/clojure
    cache-path: cache-file.tar
# ...

Build + Environment Variables

Make sure that you're providing a .buildenv file as outlined here. Afterwards, you can use the usual Github Actions env clause to supply them.

- uses: into-docker/build-action@v4
  with:
    image: target-image:latest
    builder: intodocker/clojure
  env:
    SECRET_USERNAME: ...
    SECRET_TOKEN: ...

Build + Platform

You'll need to run the setup-qemu-action first, then you can supply the desired target platform:

- uses: docker/setup-qemu-action@v3
- uses: into-docker/build-action@v4
  with:
    image: target-image:latest
    builder: intodocker/clojure
    platform: linux/arm64

Inputs

Name Required Description
builder Yes The into-docker builder image to use.
image Yes The target image that should be created (name:tag)
source-path No Path, relative to the project root, to use as build source
artifacts-path No Path, relative to the project root, to write build artifacts to
cache-path No Path to a cache archive that should be used/created
profile No Build profile (provided by the builder image) to use
platform No The target platform to build for (needs into-docker >= 1.1.4)
version No Specific version of the CLI tool to use

Outputs

None.

Development

We use prettier to ensure consistent formatting of Markdown and YAML files. Please run yarn or npm install to register the pre-commit hook.

License

MIT License

Copyright (c) 2020-2023 Yannick Scherer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.