Updated readme and releases

This commit is contained in:
Foat Akhmadeev 2024-12-18 17:49:41 +03:00
parent fcb356d992
commit 13259781fd
4 changed files with 29 additions and 26 deletions

View file

@ -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 ## Features
- Build container images with Podman. - **Build and Push:** Build container images and optionally push them to a container registry.
- Push images to a container registry (e.g., `ghcr.io`, `quay.io`). - **Flexible Configuration:** Support for build arguments, labels, tags, and security options.
- Flexible support for build arguments, labels, tags, and security options. - **CI/CD Ready:** Designed for GitHub Actions workflows.
- Designed to run in GitHub workflows for CI/CD automation. - **Shared Storage Support:** Compatible with shared storage on self-hosted runners for caching.
- Supports Gitea Actions with a shared storage between runs.
## Directory Structure ## Directory Structure
```plaintext ```plaintext
podman-action container-action
├── LICENSE # License information (MIT) ├── LICENSE # License information (MIT)
├── README.md # This documentation ├── README.md # This documentation
├── .github ├── .github
│ └── workflows │ └── workflows
│ └── verify.yml # Example GitHub workflow for verification │ └── verify.yml # Example workflow for testing
├── scripts ├── scripts
│ └── run.sh # Core script to handle Podman operations │ └── run.sh # Core script to handle Podman operations
└── action.yml # GitHub Action definition └── action.yml # GitHub Action definition
@ -28,7 +27,7 @@ podman-action
### Example Workflow ### 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 ```yaml
name: Build and Push Container Image name: Build and Push Container Image
@ -59,19 +58,18 @@ jobs:
### Inputs ### Inputs
| Input | Description | Required | Default | | Input | Description | Required | Default |
|------------------|--------------------------------------------------------------------------------------------------|----------|------------------| |------------------|---------------------------------------------------------------------------------------------------------|----------|------------------|
| `login_registry` | The container registry to push to (e.g., `ghcr.io`). | No | | | `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_username` | Registry username. | No | |
| `login_password` | Registry password (use GitHub secrets). | No | | | `login_password` | Registry password (GitHub secret recommended). | No | |
| `tags` | Tags for the image (space-separated or newline-separated). | No | | | `tags` | Tags for the image. Space-separated. e.g. `quay.io/podman/stable:latest quay.io/podman/stable:nightly`. | No | |
| `labels` | Additional metadata for the image (space-separated or newline-separated). | No | | | `labels` | List of additional metadata for an image. Space-separated. | No | |
| `build_args` | Build arguments (space-separated or newline-separated). | No | | | `build_args` | Optional build arguments. Space-separated. e.g. `MY_ENV_VAR=Test MY_ENV_VAR2=Test2`. | No | |
| `extra_args` | Extra arguments for the `podman build` command (newline-separated). | 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 | | | `dockerfile` | Path to the Dockerfile. If set, the build step is performed. | No | |
| `push` | Whether to push the image after building. | No | `false` | | `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 flags used for an intermediate container. Newline-separated. | No | `--network=host` |
| `security` | Security options for the intermediate container (space-separated). | No | `--network=host` |
## Development ## Development
@ -82,7 +80,7 @@ The `verify.yml` workflow tests the action by:
2. Building and pushing the container image. 2. Building and pushing the container image.
3. Running the container to validate its output. 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 ### Core Script
@ -97,4 +95,4 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
## Contributions ## Contributions
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue in this repository. Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue in this repository.

5
RELEASES.md Normal file
View file

@ -0,0 +1,5 @@
# Container Action releases
### v1.0.0
- Initial release

View file

@ -49,7 +49,7 @@ runs:
using: composite using: composite
steps: steps:
- name: Run container steps - name: Run container steps
uses: frozen-tapestry/docker-run-action@0c2c7831e29d4389f7521909b92e8097d1eecc88 uses: frozen-tapestry/docker-run-action@v6
with: with:
image: quay.io/podman/stable:latest image: quay.io/podman/stable:latest
mount_ws: true mount_ws: true