forked from homeall/caddy-reverse-proxy-cloudflare
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.73 KB
/
main.yml
File metadata and controls
61 lines (52 loc) · 1.73 KB
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
58
59
60
61
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set env
run: echo "TAG=$(echo $(date +%Y.%m.%d))" >> $GITHUB_ENV
- name: Docker Login to Docker Hub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3.5.0
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Login to GHCR
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3.5.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.6.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Build and Push to Docker Hub and GHCR
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' }}
tags: |
sholdee/caddy-proxy-cloudflare:latest
sholdee/caddy-proxy-cloudflare:${{ env.TAG }}
ghcr.io/${{ github.repository_owner }}/caddy-proxy-cloudflare:latest
ghcr.io/${{ github.repository_owner }}/caddy-proxy-cloudflare:${{ env.TAG }}
- name: Create GitHub Release
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1.18.0
with:
tag: ${{ env.TAG }}
allowUpdates: true
makeLatest: true