@@ -22,132 +22,3 @@ jobs:
22
22
run : nix develop --command -- goreleaser release --rm-dist
23
23
env :
24
24
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
-
26
- docker-release :
27
- runs-on : ubuntu-latest
28
- steps :
29
- - name : Checkout
30
- uses : actions/checkout@v3
31
- with :
32
- fetch-depth : 0
33
- - name : Set up Docker Buildx
34
- uses : docker/setup-buildx-action@v1
35
- - name : Set up QEMU for multiple platforms
36
- uses : docker/setup-qemu-action@master
37
- with :
38
- platforms : arm64,amd64
39
- - name : Cache Docker layers
40
- uses : actions/cache@v2
41
- with :
42
- path : /tmp/.buildx-cache
43
- key : ${{ runner.os }}-buildx-${{ github.sha }}
44
- restore-keys : |
45
- ${{ runner.os }}-buildx-
46
- - name : Docker meta
47
- id : meta
48
- uses : docker/metadata-action@v3
49
- with :
50
- # list of Docker images to use as base name for tags
51
- images : |
52
- ${{ secrets.DOCKERHUB_USERNAME }}/headscale
53
- ghcr.io/${{ github.repository_owner }}/headscale
54
- tags : |
55
- type=semver,pattern={{version}}
56
- type=semver,pattern={{major}}.{{minor}}
57
- type=semver,pattern={{major}}
58
- type=sha
59
- type=raw,value=develop
60
- - name : Login to DockerHub
61
- uses : docker/login-action@v1
62
- with :
63
- username : ${{ secrets.DOCKERHUB_USERNAME }}
64
- password : ${{ secrets.DOCKERHUB_TOKEN }}
65
- - name : Login to GHCR
66
- uses : docker/login-action@v1
67
- with :
68
- registry : ghcr.io
69
- username : ${{ github.repository_owner }}
70
- password : ${{ secrets.GITHUB_TOKEN }}
71
- - name : Build and push
72
- id : docker_build
73
- uses : docker/build-push-action@v2
74
- with :
75
- push : true
76
- context : .
77
- tags : ${{ steps.meta.outputs.tags }}
78
- labels : ${{ steps.meta.outputs.labels }}
79
- platforms : linux/amd64,linux/arm64
80
- cache-from : type=local,src=/tmp/.buildx-cache
81
- cache-to : type=local,dest=/tmp/.buildx-cache-new
82
- build-args : |
83
- VERSION=${{ steps.meta.outputs.version }}
84
- - name : Prepare cache for next build
85
- run : |
86
- rm -rf /tmp/.buildx-cache
87
- mv /tmp/.buildx-cache-new /tmp/.buildx-cache
88
-
89
- docker-debug-release :
90
- runs-on : ubuntu-latest
91
- steps :
92
- - name : Checkout
93
- uses : actions/checkout@v3
94
- with :
95
- fetch-depth : 0
96
- - name : Set up Docker Buildx
97
- uses : docker/setup-buildx-action@v1
98
- - name : Set up QEMU for multiple platforms
99
- uses : docker/setup-qemu-action@master
100
- with :
101
- platforms : arm64,amd64
102
- - name : Cache Docker layers
103
- uses : actions/cache@v2
104
- with :
105
- path : /tmp/.buildx-cache-debug
106
- key : ${{ runner.os }}-buildx-debug-${{ github.sha }}
107
- restore-keys : |
108
- ${{ runner.os }}-buildx-debug-
109
- - name : Docker meta
110
- id : meta-debug
111
- uses : docker/metadata-action@v3
112
- with :
113
- # list of Docker images to use as base name for tags
114
- images : |
115
- ${{ secrets.DOCKERHUB_USERNAME }}/headscale
116
- ghcr.io/${{ github.repository_owner }}/headscale
117
- flavor : |
118
- suffix=-debug,onlatest=true
119
- tags : |
120
- type=semver,pattern={{version}}
121
- type=semver,pattern={{major}}.{{minor}}
122
- type=semver,pattern={{major}}
123
- type=sha
124
- type=raw,value=develop
125
- - name : Login to DockerHub
126
- uses : docker/login-action@v1
127
- with :
128
- username : ${{ secrets.DOCKERHUB_USERNAME }}
129
- password : ${{ secrets.DOCKERHUB_TOKEN }}
130
- - name : Login to GHCR
131
- uses : docker/login-action@v1
132
- with :
133
- registry : ghcr.io
134
- username : ${{ github.repository_owner }}
135
- password : ${{ secrets.GITHUB_TOKEN }}
136
- - name : Build and push
137
- id : docker_build
138
- uses : docker/build-push-action@v2
139
- with :
140
- push : true
141
- context : .
142
- file : Dockerfile.debug
143
- tags : ${{ steps.meta-debug.outputs.tags }}
144
- labels : ${{ steps.meta-debug.outputs.labels }}
145
- platforms : linux/amd64,linux/arm64
146
- cache-from : type=local,src=/tmp/.buildx-cache-debug
147
- cache-to : type=local,dest=/tmp/.buildx-cache-debug-new
148
- build-args : |
149
- VERSION=${{ steps.meta-debug.outputs.version }}
150
- - name : Prepare cache for next build
151
- run : |
152
- rm -rf /tmp/.buildx-cache-debug
153
- mv /tmp/.buildx-cache-debug-new /tmp/.buildx-cache-debug
0 commit comments