Skip to content

Commit 0c4a324

Browse files
committed
Add Github workflows to create httpd-tools container image
With that image, we don't need to create container image each time when crc-cloud is deployed. Signed-off-by: Daniel Pawlik <[email protected]>
1 parent f6ed2f2 commit 0c4a324

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Build and push container image
3+
4+
on:
5+
push:
6+
branches: ['main']
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to GitHub Container Registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Build and push Docker image
27+
run: |
28+
echo -e 'FROM quay.io/centos/centos:stream9-minimal\nRUN microdnf --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install -y httpd-tools\nENTRYPOINT ["htpasswd", "-Bbn"]' | docker build -t ghcr.io/${{ github.repository }}/httpd-tools:latest -t ghcr.io/${{ github.repository }}/httpd-tools:${{ github.sha }} -
29+
docker push ghcr.io/${{ github.repository }}/httpd-tools:latest
30+
docker push ghcr.io/${{ github.repository }}/httpd-tools:${{ github.sha }}

0 commit comments

Comments
 (0)