forked from SoftEtherVPN/SoftEtherVPN
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.52 KB
/
docker-linux.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
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
buildx:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v4
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: false
load: true
platforms: ${{ matrix.platform }}
tags: "softether:latest"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Save Docker image as tar.xz
run: docker save softether:latest > softether_$PLATFORM_PAIR.tar && xz -kv9T0 softether_$PLATFORM_PAIR.tar && echo "FILENAME=softether_$PLATFORM_PAIR.tar.xz" >>$GITHUB_ENV
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME }}
path: ${{ env.FILENAME }}
compression-level: 0