-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_cpu_main.yml
More file actions
79 lines (65 loc) · 2.2 KB
/
build_cpu_main.yml
File metadata and controls
79 lines (65 loc) · 2.2 KB
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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Main Build and push Amd64 CPU (no tagging)
on:
workflow_run:
workflows: [Tag main commit with version number]
types:
- completed
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodule core -- pull submodule
uses: actions/checkout@v3
with:
repository: DecentrAI/core
path: core
- name: Checkout submodule core
run:
git submodule update --init --recursive
- name: Retrieve version
id: retrieve_version
run: |
echo "VERSION=$(cat ver.py | grep -o "'.*'")" >> $GITHUB_ENV
- name: Create image tag
id: create_image_tag
run: |
VERSION=${VERSION//\'/}
echo "IMAGE_TAG=naeural/edge_node:cpu-$VERSION" >> $GITHUB_ENV
env:
VERSION: ${{ env.VERSION }}
- name: Debug version
run: |
VERSION=${VERSION//\'/}
echo "Version to tag: '$VERSION'"
env:
VERSION: ${{ env.VERSION }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
endpoint: "naeural/naeural-builder"
- name: Cleanup space
run: |
echo "===========docker buildx du ==================="
docker buildx du
echo "===========docker buildx prune -f. Add -af if any other space issues. ============"
docker buildx prune -f
echo "===========docker buildx du ================="
docker buildx du
echo "========================================"
- name: Build and push Arm64 CPU
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile_cpu
push: true
tags: ${{ env.IMAGE_TAG }}