From 13259781fd76bb6fd36bbc98ba1c0741dc528daa Mon Sep 17 00:00:00 2001 From: Foat Akhmadeev Date: Wed, 18 Dec 2024 17:49:41 +0300 Subject: [PATCH] Updated readme and releases --- README.md | 48 ++++++++++++------------ RELEASES.md | 5 +++ action.yml | 2 +- {.github => github}/workflows/verify.yml | 0 4 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 RELEASES.md rename {.github => github}/workflows/verify.yml (100%) diff --git a/README.md b/README.md index 6f1bf9f..1dd80c6 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,23 @@ -# Podman (Login,Build,Push) GitHub Action +# Podman (Login, Build, Push) GitHub Action -This repository provides a GitHub Action to build and push container images using [Podman](https://podman.io/). It supports Podman login, building images from Dockerfiles, and pushing images to container registries. +This repository provides a GitHub Action to build and push container images using [Podman](https://podman.io/). The action supports Podman login, building images from Dockerfiles, and pushing images to container registries. It is designed to work seamlessly within GitHub workflows to automate CI/CD pipelines. ## Features -- Build container images with Podman. -- Push images to a container registry (e.g., `ghcr.io`, `quay.io`). -- Flexible support for build arguments, labels, tags, and security options. -- Designed to run in GitHub workflows for CI/CD automation. -- Supports Gitea Actions with a shared storage between runs. +- **Build and Push:** Build container images and optionally push them to a container registry. +- **Flexible Configuration:** Support for build arguments, labels, tags, and security options. +- **CI/CD Ready:** Designed for GitHub Actions workflows. +- **Shared Storage Support:** Compatible with shared storage on self-hosted runners for caching. ## Directory Structure ```plaintext -podman-action +container-action ├── LICENSE # License information (MIT) ├── README.md # This documentation ├── .github │ └── workflows -│ └── verify.yml # Example GitHub workflow for verification +│ └── verify.yml # Example workflow for testing ├── scripts │ └── run.sh # Core script to handle Podman operations └── action.yml # GitHub Action definition @@ -28,7 +27,7 @@ podman-action ### Example Workflow -Add the following workflow file to `.github/workflows/build.yml`: +To use this action in a workflow, create a file `.github/workflows/build.yml` with the following content: ```yaml name: Build and Push Container Image @@ -59,19 +58,18 @@ jobs: ### Inputs -| Input | Description | Required | Default | -|------------------|--------------------------------------------------------------------------------------------------|----------|------------------| -| `login_registry` | The container registry to push to (e.g., `ghcr.io`). | No | | -| `login_username` | Registry username. | No | | -| `login_password` | Registry password (use GitHub secrets). | No | | -| `tags` | Tags for the image (space-separated or newline-separated). | No | | -| `labels` | Additional metadata for the image (space-separated or newline-separated). | No | | -| `build_args` | Build arguments (space-separated or newline-separated). | No | | -| `extra_args` | Extra arguments for the `podman build` command (newline-separated). | No | | -| `dockerfile` | Path to the Dockerfile. If set, the build step is performed. | No | | -| `push` | Whether to push the image after building. | No | `false` | -| `shared_path` | Path to a shared folder for cache files on the host filesystem (useful for self-hosted runners). | No | `/tmp/shared` | -| `security` | Security options for the intermediate container (space-separated). | No | `--network=host` | +| Input | Description | Required | Default | +|------------------|---------------------------------------------------------------------------------------------------------|----------|------------------| +| `login_registry` | Container registry to push to (e.g., `quay.io`). If not set, the image is only built locally. | No | | +| `login_username` | Registry username. | No | | +| `login_password` | Registry password (GitHub secret recommended). | No | | +| `tags` | Tags for the image. Space-separated. e.g. `quay.io/podman/stable:latest quay.io/podman/stable:nightly`. | No | | +| `labels` | List of additional metadata for an image. Space-separated. | No | | +| `build_args` | Optional build arguments. Space-separated. e.g. `MY_ENV_VAR=Test MY_ENV_VAR2=Test2`. | No | | +| `extra_args` | Extra arguments to be passed to Podman. Space-separated. e.g. `-e=MY_ENV=Test -e=MY_ENV=Test2`. | No | | +| `dockerfile` | Path to the Dockerfile. If set, the build step is performed. | No | | +| `push` | Whether to push the image after building. | No | `false` | +| `security` | Security flags used for an intermediate container. Newline-separated. | No | `--network=host` | ## Development @@ -82,7 +80,7 @@ The `verify.yml` workflow tests the action by: 2. Building and pushing the container image. 3. Running the container to validate its output. -You can use this workflow as a template for testing your own usage. +You can use this workflow as a template for testing your own usage. It is located at `.github/workflows/verify.yml`. ### Core Script @@ -97,4 +95,4 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file ## Contributions -Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue in this repository. \ No newline at end of file +Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue in this repository. diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..bbb5869 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,5 @@ +# Container Action releases + +### v1.0.0 + +- Initial release \ No newline at end of file diff --git a/action.yml b/action.yml index 3cb22c7..d65ef38 100644 --- a/action.yml +++ b/action.yml @@ -49,7 +49,7 @@ runs: using: composite steps: - name: Run container steps - uses: frozen-tapestry/docker-run-action@0c2c7831e29d4389f7521909b92e8097d1eecc88 + uses: frozen-tapestry/docker-run-action@v6 with: image: quay.io/podman/stable:latest mount_ws: true diff --git a/.github/workflows/verify.yml b/github/workflows/verify.yml similarity index 100% rename from .github/workflows/verify.yml rename to github/workflows/verify.yml