-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.51 KB
/
release_docker.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
name: Release Docker
on:
push:
tags:
- "*"
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest]
go-version: ["1.22"]
name: Release
runs-on: ${{ matrix.platform }}
steps:
- name: 检出分支
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: |
sudo apt install musl-tools
sudo apt install wget
- name: Arm dependencies
run: |
wget -P ~ https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xvf ~/aarch64-linux-musl-cross.tgz -C ~
- name: Build
run: |
bash build.sh docker
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Push
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: "${{ secrets.DOCKER_REPOSITORY }}:${{ steps.get_version.outputs.VERSION }},${{ secrets.DOCKER_REPOSITORY }}:latest"