-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.99 KB
/
docker-build.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# ref _ee\build-nginx\.github\workflows\docker-build.yaml
name: "Build and push Docker image"
on:
push:
branches: ["*"]
tags: ["*"]
# schedule:
# - cron: "0 0 * * 0"
jobs:
main:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: Setup QEMU
# uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2 #ref docker-baseimage-gui
with:
platforms: arm,arm64,ppc64le,mips64,s390x
- name: Setup Docker Buildx
# uses: docker/setup-buildx-action@
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- 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;
docker image prune -a -f; df -h
# 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/"
echo undockPkg; doBuild=true
test "true" == "$doBuild" && bash build/buildx.sh #nginx
# echo undockPkg; doPkg=true
# cd .github/workflows; test "true" == "$doPkg" && bash undock.sh;
# ###############################################
- name: create github release
id: new_release
uses: softprops/action-gh-release@v2 #v2.0.8
# if: startsWith(github.ref, 'refs/tags/')
with:
name: latest
tag_name: v24.12
make_latest: true
token: ${{ github.token }} #Defaults to ${{ github.token }}
body: |
Automated release-2024 for tag ${{ github.ref }}
- `docker run -it --rm --net=host registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-registry:latest`
# append_body
# generate_release_notes
draft: false
prerelease: false
preserve_order: true
fail_on_unmatched_files: false
# repository: #Defaults to GITHUB_REPOSITORY env variable
# body_path:
# target_commitish
files: |
# LICENSE
# .github/workflows/.ws/pkgs/nginx*.tar.gz
build/docker-registry*.tar.gz