feat: initial commit
Some checks failed
Build and Push Docker Image / build (push) Failing after 39s
Some checks failed
Build and Push Docker Image / build (push) Failing after 39s
This commit is contained in:
commit
6fba8ac7c1
26
.gitea/workflows/build.yml
Normal file
26
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,26 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
run: ./build_all.sh
|
||||
19
build_all.sh
Normal file
19
build_all.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Loop through each directory in the builds directory
|
||||
for dir in builds/*/ ; do
|
||||
# Remove trailing slash from directory name
|
||||
dir=${dir%/}
|
||||
|
||||
# Extract the folder name
|
||||
folder_name=$(basename $dir)
|
||||
|
||||
# Build the Docker image
|
||||
docker build -t caddy-$folder_name $dir
|
||||
|
||||
# Tag the Docker image for pushing to the repository
|
||||
docker tag caddy-$folder_name linloir/caddy-$folder_name
|
||||
|
||||
# Push the Docker image to the repository
|
||||
docker push linloir/caddy-$folder_name
|
||||
done
|
||||
10
builds/dns/Dockerfile
Normal file
10
builds/dns/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM caddy:builder AS builder
|
||||
|
||||
RUN xcaddy build \
|
||||
--with github.com/caddy-dns/cloudflare \
|
||||
--with github.com/caddy-dns/dnspod \
|
||||
--with github.com/caddy-dns/alidns
|
||||
|
||||
FROM caddy:latest
|
||||
|
||||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
||||
Loading…
x
Reference in New Issue
Block a user