-
Notifications
You must be signed in to change notification settings - Fork 19
107 lines (98 loc) · 4.15 KB
/
docker-image.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: docker-image
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - name: Build the Docker image
# run: cd ubt-core; docker build . --file src/Dockerfile --tag docker-headless:t1-$(date +%s)
# ref: fk-nezha
# - name: Login to repo:AliyunCS
# uses: docker/login-action@master
# with:
# registry: registry.cn-shenzhen.aliyuncs.com
# username: ${{ secrets.DOCKER_REGISTRY_USER_INFRASTSUBUSER2 }}
# password: ${{ secrets.DOCKER_REGISTRY_PW_INFRASTSUBUSER2 }}
# - name: Login to repo:DockerHub
# uses: docker/login-action@master
# with:
# registry: registry-1.docker.io
# username: ${{ secrets.DOCKER_REGISTRY_USER_DOCKERHUB }}
# password: ${{ secrets.DOCKER_REGISTRY_PW_DOCKERHUB }}
# - name: Build dasbboard image And Push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./Dockerfile
# platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/riscv64 # linux/386,
# push: true
# tags: |
# ${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}:${{ steps.extract_branch.outputs.tag }}
# ${{ steps.image-name.outputs.ALI_IMAGE_NAME }}:${{ steps.extract_branch.outputs.tag }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Call buildx.sh(build with ali's cache, push)
run: |
# VARS
echo ${{ github.repository_owner }} #infrastlabs
echo ${{ github.repository }}
echo ${{ secrets.DOCKER_REGISTRY_PW_DOCKERHUB }} #fill not show in log
# INFO
pwd && ls -l
docker version
free -h; df -h; ip a |grep inet; uname -a;
# ENV
# registry-1.docker.io| noneView
export DOCKER_REGISTRY_USER_dockerhub=${{ secrets.DOCKER_REGISTRY_USER_DOCKERHUB }}
export DOCKER_REGISTRY_PW_dockerhub=${{ secrets.DOCKER_REGISTRY_PW_DOCKERHUB }}
# ali's| size, none-arch, layers;
export DOCKER_REGISTRY_USER_infrastSubUser2=${{ secrets.DOCKER_REGISTRY_USER_INFRASTSUBUSER2 }}
export DOCKER_REGISTRY_PW_infrastSubUser2=${{ secrets.DOCKER_REGISTRY_PW_INFRASTSUBUSER2 }}
export REPO_HUB=registry-1.docker.io
export REPO_ALI=registry.cn-shenzhen.aliyuncs.com
export REPO=$REPO_ALI #REPO_HUB REPO_ALI ##without "xx/"
# BUILD
:> /tmp/.timecost
# echo core; cd ubt-core;
# # sh buildx.sh compile
# # sh buildx.sh slim; sh buildx.sh base
# sh buildx.sh #core
# #HEADLESS's merge
# if [ "infrastlabs/docker-headless" == "${{ github.repository }}" ]; then
# echo custom; cd ../ubt-custom; sh buildx.sh; #sh buildx.sh sogou;
# echo desktop; cd ../ubt-desktop;
# sh buildx.sh; sh buildx.sh plasma;
# sh buildx.sh cxfce; sh buildx.sh cinna; #sh buildx.sh cmate;
# fi
cd .github; doBuild=true
if [ "true" == "$doBuild" ]; then
echo distros; cd ../distros;
# bash buildx.sh type dist ver [latest]
# app
bash buildx.sh app alpine 3.19 latest &
# # bash buildx.sh app ubuntu 20.04 &
# bash buildx.sh app ubuntu 22.04 &
# bash buildx.sh app ubuntu 24.04 latest &
bash buildx.sh app debian 10 &
bash buildx.sh app debian 11 &
bash buildx.sh app debian 12 latest &
# bash buildx.sh app opensuse 15.0 & ##
# bash buildx.sh app opensuse 15.5 latest &
wait
fi
#
# 同步到ali仓
#REPO_ALI>> REPO_HUB REPO_TEN REPO_QING
unset REPO_ALI REPO_TEN REPO_QING #skipSync
echo syncer; doSync=true
cd ../.github/workflows; test "true" == "$doSync" && bash syncer.sh;
#
# view timecost
cat /tmp/.timecost