-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (49 loc) · 2.22 KB
/
docker.yml
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
name: Docker Images CI
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Set up QEMU 💿
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx 🔩
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub 📶
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push server 📲
uses: docker/build-push-action@v4
with:
context: .
# platforms: linux/amd64,linux/arm64
# can not compile linux/arm64v8 in Github Action
#
# Manually compile
# 1. Build mirror images of different platforms
# - `docker build -t zingerbee/amd64-netop -f deploy/Dockerfile .` in amd64 CPU
# - `docker build -t zingerbee/arm64v8-netop -f deploy/Dockerfile .` in arm64v8 CPU
# 2. Push mirror images to DockerHub
# `docker login`
# - `docker push zingerbee/amd64-netop`
# - `docker push zingerbee/arm64v8-netop`
# 3. Create manifest
# `docker manifest create zingerbee/netop zingerbee/amd64-netop zingerbee/arm64v8-netop`
# 4. Set manifest
# - `docker manifest annotate zingerbee/netop zingerbee/amd64-netop --os linux --arch amd64`
# - `docker manifest annotate zingerbee/netop zingerbee/arm64v8-netop --os linux --arch arm64 --variant v8`
# (Optional) Inspect manifest
# `docker manifest inspect zingerbee/netop`
# 5. Push manifest
# `docker manifest push zingerbee/netop`
file: ./deploy/Dockerfile
push: true
# `zingerbee/arm64v8-netop:latest` need manually compile and publish
tags: zingerbee/amd64-netop:latest