forked from visibilityspots/dockerfile-cloudflared
-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (71 loc) · 2.12 KB
/
main.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
schedule:
- cron: '55 9 * * 1'
permissions:
packages: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t knight/cloudflared-dns:dev .
- name: Install Goss
uses: e1himself/[email protected]
with:
version: 'v0.4.9'
- name: Execute Goss tests
env:
GOSS_FILES_STRATEGY: cp
run: dgoss run knight/cloudflared-dns:dev
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push latest
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/arm64
linux/arm/v6
linux/arm/v7
linux/ppc64le
linux/s390x
linux/386
linux/riscv64
push: true
sbom: true
provenance: mode=max
tags: |
knight/cloudflared-dns:latest
knight/cloudflared-dns:${{ steps.date.outputs.date }}
ghcr.io/knight1/cloudflared:latest
ghcr.io/knight1/cloudflared:${{ steps.date.outputs.date }}
cache-from: type=registry,ref=knight/cloudflared-dns:buildcache
cache-to: type=registry,ref=knight/cloudflared-dns:buildcache,mode=max