File tree 2 files changed +57
-3
lines changed
2 files changed +57
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : publish
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' *'
7
+
8
+ jobs :
9
+ publish :
10
+ permissions :
11
+ packages : write
12
+
13
+ runs-on : actuated
14
+ steps :
15
+ - uses : actions/checkout@master
16
+ with :
17
+ fetch-depth : 1
18
+
19
+ - name : Setup mirror
20
+ uses : self-actuated/hub-mirror@master
21
+ - name : Get TAG
22
+ id : get_tag
23
+ run : echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
24
+ - name : Get Repo Owner
25
+ id : get_repo_owner
26
+ run : echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
27
+
28
+ - name : Set up QEMU
29
+ uses : docker/setup-qemu-action@v2
30
+ - name : Set up Docker Buildx
31
+ uses : docker/setup-buildx-action@v2
32
+ - name : Login to container Registry
33
+ uses : docker/login-action@v2
34
+ with :
35
+ username : ${{ github.repository_owner }}
36
+ password : ${{ secrets.GITHUB_TOKEN }}
37
+ registry : ghcr.io
38
+
39
+ - name : Release build
40
+ id : release_build
41
+ uses : docker/build-push-action@v4
42
+ with :
43
+ outputs : " type=registry,push=true"
44
+ provenance : false
45
+ platforms : linux/amd64,linux/arm/v6,linux/arm64
46
+ tags : |
47
+ ghcr.io/${{ env.REPO_OWNER }}/mini-mail-dev:${{ github.sha }}
48
+ ghcr.io/${{ env.REPO_OWNER }}/mini-mail-dev:${{ env.TAG }}
49
+ ghcr.io/${{ env.REPO_OWNER }}/mini-mail-dev:latest
Original file line number Diff line number Diff line change 1
- FROM node:20-slim AS frontend
1
+ ARG BUILDPLATFORM
2
+ ARG TARGETOS
3
+ ARG TARGETARCH
4
+
5
+ FROM node:21-slim AS frontend
2
6
3
7
COPY . .
4
8
5
9
RUN npm install && npm run build
6
10
7
- FROM golang:1.21
11
+ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.21
8
12
9
13
WORKDIR /usr/src/app
10
14
@@ -16,7 +20,8 @@ COPY go go
16
20
COPY main.go .
17
21
COPY --from=frontend dist dist
18
22
19
- RUN go build -o /usr/bin/mini-mail-dev && \
23
+ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
24
+ go build -o /usr/bin/mini-mail-dev && \
20
25
rm -rf go main.go go.mod go.sum dist
21
26
22
27
EXPOSE 1025/tcp
You can’t perform that action at this time.
0 commit comments