Browse Source

add docker_arm64.yml

ljw 1 year ago
parent
commit
3cad3994cb
1 changed files with 35 additions and 0 deletions
  1. 35 0
      .github/workflows/docker_arm64.yml

+ 35 - 0
.github/workflows/docker_arm64.yml

@@ -0,0 +1,35 @@
1
+name: Build and Push Docker Arm64 Image
2
+
3
+on:
4
+  push:
5
+    tags:
6
+      - 'v*.*.*'  # 仅当推送标签(例如 v1.0.0)时触发
7
+
8
+jobs:
9
+  build:
10
+    runs-on: ubuntu-latest
11
+
12
+    steps:
13
+      - name: Checkout code
14
+        uses: actions/checkout@v4
15
+
16
+      - name: Set up Docker Buildx
17
+        uses: docker/setup-buildx-action@v3
18
+
19
+      - name: Log in to Docker Hub
20
+        uses: docker/login-action@v2
21
+        with:
22
+          username: ${{ secrets.DOCKER_USERNAME }}
23
+          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
24
+
25
+      - name: Extract version from tag
26
+        id: vars
27
+        run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
28
+
29
+      - name: Build and push Docker image
30
+        id: push
31
+        run: |
32
+          docker buildx create --use
33
+          docker buildx build --platform linux/arm64 \
34
+            -t lejianwen/rustdesk-api:${{ env.TAG }}-arm64 \
35
+            --push .