Skip to content

Commit 485c95b

Browse files
committed
upgrade sass and build on arm
Signed-off-by: YangKeao <[email protected]>
1 parent 8159f13 commit 485c95b

File tree

4 files changed

+1093
-652
lines changed

4 files changed

+1093
-652
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Upload Image
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build-specific-architecture:
9+
strategy:
10+
matrix:
11+
arch: [amd64, arm64]
12+
runs-on: ${{ fromJson('{"amd64":"ubuntu-latest", "arm64":["self-hosted", "Linux", "ARM64"]}')[matrix.arch] }}
13+
steps:
14+
- name: checkout codes
15+
uses: actions/checkout@v2
16+
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 14
20+
- uses: actions/setup-go@v3
21+
with:
22+
go-version: '^1.18.1'
23+
24+
- name: install dependencies
25+
run: |
26+
sudo apt update -y
27+
sudo apt install g++ build-essential python3 -y
28+
29+
- name: build web-show images
30+
env:
31+
ARCH: ${{ matrix.arch }}
32+
run: |
33+
make build
34+
IMAGE_TAG=latest-$ARCH make image
35+
36+
- name: log in to GitHub Docker Registry
37+
uses: docker/login-action@v1
38+
with:
39+
registry: ghcr.io
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: upload web-show
44+
env:
45+
ARCH: ${{ matrix.arch }}
46+
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
47+
run: |
48+
# ${VAR,,} convert VAR to lower case
49+
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest-$ARCH
50+
51+
52+
upload-manifest:
53+
runs-on: ubuntu-latest
54+
needs: build-specific-architecture
55+
steps:
56+
- name: build manifest
57+
env:
58+
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
59+
run: |
60+
# ${VAR,,} convert VAR to lower case
61+
docker manifest create ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest \
62+
ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest-amd64 \
63+
ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest-arm64
64+
65+
docker manifest annotate ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest \
66+
ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest-amd64 \
67+
--os linux --arch amd64
68+
docker manifest annotate ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest \
69+
ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest-arm64 \
70+
--os linux --arch arm64
71+
72+
- name: Log in to GitHub Docker Registry
73+
uses: docker/login-action@v1
74+
with:
75+
registry: ghcr.io
76+
username: ${{ github.actor }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: Upload Chaos Mesh
80+
env:
81+
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
82+
run: |
83+
# ${VAR,,} convert VAR to lower case
84+
docker manifest push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/web-show:latest

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# SET DOCKER_REGISTRY to change the docker registry
2-
DOCKER_REGISTRY_PREFIX := $(if $(DOCKER_REGISTRY),$(DOCKER_REGISTRY)/,)
2+
DOCKER_REGISTRY_PREFIX := $(if $(DOCKER_REGISTRY),$(DOCKER_REGISTRY)/,ghcr.io/)
3+
IMAGE_TAG := $(if $(IMAGE_TAG),$(IMAGE_TAG),"latest")
34

45
# Enable GO111MODULE=on explicitly, disable it with GO111MODULE=off when necessary.
56
export GO111MODULE := on
6-
GOOS := $(if $(GOOS),$(GOOS),"linux")
7-
GOARCH := $(if $(GOARCH),$(GOARCH),"amd64")
8-
GOENV := GO15VENDOREXPERIMENT="1" CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH)
9-
CGOENV := GO15VENDOREXPERIMENT="1" CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH)
7+
GOENV := GO15VENDOREXPERIMENT="1" CGO_ENABLED=0
8+
CGOENV := GO15VENDOREXPERIMENT="1" CGO_ENABLED=1
109
GO := $(GOENV) go
1110

1211
default: build image image-push
@@ -16,10 +15,10 @@ build:
1615
cd web; npm install; npm run build
1716

1817
image:
19-
docker build -t ${DOCKER_REGISTRY_PREFIX}pingcap/web-show .
18+
docker build -t ${DOCKER_REGISTRY_PREFIX}chaos-mesh/web-show:${IMAGE_TAG} .
2019

2120
image-push:
22-
docker push "${DOCKER_REGISTRY_PREFIX}pingcap/web-show:latest"
21+
docker push "${DOCKER_REGISTRY_PREFIX}chaos-mesh/web-show:latest"
2322

2423

2524
.PYTHON: build

0 commit comments

Comments
 (0)