Skip to content

Commit

Permalink
ci: arm64 build accelerate
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Jul 22, 2020
1 parent 7ecfe73 commit 19201a3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/build-arm64-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,38 @@ jobs:
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1.4.0

- name: Go Build Cache
uses: actions/cache@v2
with:
path: /home/runner/.cache/go-build
key: ${{ runner.os }}-arm64-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-arm64-go-build-
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-arm64-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-arm64-go-
- name: Cache Docker layers
uses: actions/cache@v2
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-arm64-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-arm64-buildx-
- name: Build
run: |
go get -u github.com/securego/gosec/cmd/gosec
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ release: lint build-go
docker buildx build --cache-from "type=local,src=/tmp/.buildx-cache" --cache-to "type=local,dest=/tmp/.buildx-cache" --platform linux/amd64 --build-arg ARCH=amd64 --build-arg RPM_ARCH=x86_64 -t ${REGISTRY}/kube-ovn:${RELEASE_TAG} -o type=docker -f dist/images/Dockerfile dist/images/

release-arm: lint build-go-arm
docker buildx build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg RPM_ARCH=aarch64 -t ${REGISTRY}/kube-ovn:${RELEASE_TAG} -o type=docker -f dist/images/Dockerfile dist/images/
docker buildx build --cache-from "type=local,src=/tmp/.buildx-cache" --cache-to "type=local,dest=/tmp/.buildx-cache" --platform linux/arm64 --build-arg ARCH=arm64 --build-arg RPM_ARCH=aarch64 -t ${REGISTRY}/kube-ovn:${RELEASE_TAG} -o type=docker -f dist/images/Dockerfile dist/images/

tar:
docker save ${REGISTRY}/kube-ovn:${RELEASE_TAG} > image.tar
Expand Down

0 comments on commit 19201a3

Please sign in to comment.