-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.4 KB
/
caddy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Caddy
on:
push:
branches: ["main"]
paths:
- "docker/proxy/**"
workflow_dispatch:
jobs:
format:
name: Format Caddyfile
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Docker
uses: docker/setup-qemu-action@v3
- name: Format Caddyfile
run: docker run --rm -v $(pwd)/docker/proxy/Caddyfile:/Caddyfile caddy:2 caddy fmt /Caddyfile
- name: Commit changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email ""
git add docker/proxy/Caddyfile
git commit -m "Auto Format Caddyfile"
git push
build-image:
name: Build Caddy (custom image w/ Cloudflare)
runs-on: ubuntu-22.04
defaults:
run:
working-directory: "./docker/proxy"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: "Login to GitHub Container Registry"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build Image
run: |
docker build . --tag ghcr.io/orangeunilabs/caddy:latest
- name: Push Image
run: |
docker push ghcr.io/orangeunilabs/caddy:latest