|
1 |
| -# Docker Build & Push GitHub Actions |
| 1 | +# Plane GitHub Actions |
2 | 2 |
|
3 |
| -## Build and Push Docker Image Action |
| 3 | +A collection of reusable GitHub Actions for Plane's CI/CD workflows. |
4 | 4 |
|
5 |
| -A reusable GitHub Action for building and pushing Docker images to both DockerHub and private registries. This action supports multi-platform builds using Docker Buildx and includes features for release management. |
| 5 | +## Available Actions |
6 | 6 |
|
7 |
| -### Features |
| 7 | +### [Docker Build & Push](./build-push) |
| 8 | +Build and push Docker images to DockerHub and private registries with support for: |
| 9 | +- Multi-platform builds using Docker Buildx |
| 10 | +- Smart tagging system for releases |
| 11 | +- Private registry support |
| 12 | +- Build arguments and more |
8 | 13 |
|
9 |
| -- 🔄 Multi-platform builds using Docker Buildx |
10 |
| -- 🏷️ Smart tagging system for releases and branches |
11 |
| -- 🔐 Support for both DockerHub and private registries |
12 |
| -- 📦 Build arguments support |
13 |
| -- 🚀 Release management with semantic versioning |
| 14 | +## Usage |
14 | 15 |
|
15 |
| -### Usage |
16 |
| - |
17 |
| -```yaml |
18 |
| -- name: Build and Push Docker Image |
19 |
| - uses: makeplane/actions/[email protected] |
20 |
| - with: |
21 |
| - # Required Parameters |
22 |
| - dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} |
23 |
| - dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} |
24 |
| - docker-image-owner: your-org-name |
25 |
| - docker-image-name: your-image-name |
26 |
| - dockerfile-path: ./Dockerfile |
27 |
| - |
28 |
| - # Optional Parameters with defaults |
29 |
| - build-context: "." |
30 |
| - buildx-driver: "docker-container" |
31 |
| - buildx-version: "latest" |
32 |
| - buildx-platforms: "linux/amd64" |
33 |
| - buildx-endpoint: "default" |
34 |
| -``` |
35 |
| -
|
36 |
| -### Inputs |
37 |
| -
|
38 |
| -#### Authentication |
39 |
| -| Input | Description | Required | Default | |
40 |
| -|-------|-------------|----------|---------| |
41 |
| -| `dockerhub-username` | DockerHub username | Yes | - | |
42 |
| -| `dockerhub-token` | DockerHub token | Yes | - | |
43 |
| - |
44 |
| -#### Private Registry Options |
45 |
| -| Input | Description | Required | Default | |
46 |
| -|-------|-------------|----------|---------| |
47 |
| -| `private-registry-push` | Enable push to private registry | No | `"false"` | |
48 |
| -| `private-registry-username` | Private registry username | No | `""` | |
49 |
| -| `private-registry-token` | Private registry token | No | `""` | |
50 |
| -| `private-registry-addr` | Private registry address | No | `"registry.plane.tools"` | |
51 |
| -| `private-registry-project` | Private registry project | No | `"plane"` | |
52 |
| - |
53 |
| -#### Docker Image Options |
54 |
| -| Input | Description | Required | Default | |
55 |
| -|-------|-------------|----------|---------| |
56 |
| -| `docker-image-owner` | Docker image owner/organization | Yes | - | |
57 |
| -| `docker-image-name` | Docker image name | Yes | - | |
58 |
| -| `build-context` | Build context path | No | `"."` | |
59 |
| -| `dockerfile-path` | Path to Dockerfile | Yes | - | |
60 |
| -| `build-args` | Build arguments | No | `""` | |
61 |
| - |
62 |
| -#### Buildx Options |
63 |
| -| Input | Description | Required | Default | |
64 |
| -|-------|-------------|----------|---------| |
65 |
| -| `buildx-driver` | Buildx driver | No | `"docker-container"` | |
66 |
| -| `buildx-version` | Buildx version | No | `"latest"` | |
67 |
| -| `buildx-platforms` | Build platforms | No | `"linux/amd64"` | |
68 |
| -| `buildx-endpoint` | Buildx endpoint | No | `"default"` | |
69 |
| - |
70 |
| -#### Release Options |
71 |
| -| Input | Description | Required | Default | |
72 |
| -|-------|-------------|----------|---------| |
73 |
| -| `build-release` | Enable release build | No | `"false"` | |
74 |
| -| `build-prerelease` | Mark as pre-release | No | `"false"` | |
75 |
| -| `release-version` | Release version | No | `"latest"` | |
76 |
| - |
77 |
| -### Tag Generation |
78 |
| - |
79 |
| -The action automatically generates Docker image tags based on the following rules: |
80 |
| - |
81 |
| -1. **Release Build** (`build-release: true`): |
82 |
| - - Uses semantic versioning (e.g., v1.2.3) |
83 |
| - - Adds `:stable` tag for non-pre-releases |
84 |
| - - Validates version format using regex |
85 |
| - |
86 |
| -2. **Master Branch**: |
87 |
| - - Tags as `:latest` |
88 |
| - |
89 |
| -3. **Other Branches**: |
90 |
| - - Uses sanitized branch name as tag |
91 |
| - |
92 |
| -### Example Workflows |
93 |
| - |
94 |
| -#### Basic Usage |
95 |
| -```yaml |
96 |
| -jobs: |
97 |
| - build: |
98 |
| - runs-on: ubuntu-latest |
99 |
| - steps: |
100 |
| - - name: Build and Push |
101 |
| - uses: makeplane/actions/[email protected] |
102 |
| - with: |
103 |
| - dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} |
104 |
| - dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} |
105 |
| - docker-image-owner: myorg |
106 |
| - docker-image-name: myapp |
107 |
| - dockerfile-path: ./Dockerfile |
108 |
| -``` |
109 |
| - |
110 |
| -#### Multi-Platform Release Build |
111 |
| -```yaml |
112 |
| -jobs: |
113 |
| - release: |
114 |
| - runs-on: ubuntu-latest |
115 |
| - steps: |
116 |
| - - name: Build and Push Release |
117 |
| - uses: makeplane/actions/[email protected] |
118 |
| - with: |
119 |
| - dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} |
120 |
| - dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} |
121 |
| - docker-image-owner: myorg |
122 |
| - docker-image-name: myapp |
123 |
| - dockerfile-path: ./Dockerfile |
124 |
| - build-release: "true" |
125 |
| - release-version: "v1.0.0" |
126 |
| - buildx-platforms: "linux/amd64,linux/arm64" |
127 |
| -``` |
| 16 | +Each action has its own README with detailed documentation and examples. Click the links above to learn more about specific actions. |
0 commit comments