@@ -15,30 +15,65 @@ concurrency:
15
15
jobs :
16
16
basic-check :
17
17
runs-on : ubuntu-latest
18
- strategy :
19
- matrix :
20
- python-version : ["3.10"]
18
+ outputs :
19
+ tag : ${{ steps.read_version.outputs.value }}
21
20
steps :
22
21
- uses : actions/checkout@v3
23
- # - uses: 01-ai/actions/lint@main
22
+ - name : Checkout Actions
23
+ uses : actions/checkout@v3
24
+ with :
25
+ repository : 01-ai/actions
26
+ token : ${{ secrets.PAT_TO_CLONE_ACTIONS }}
27
+ path : actions
28
+ ref : main
29
+ - name : Basic check
30
+ uses : ./actions/lint
31
+ # https://github.com/actions/checkout/issues/692#issuecomment-1502203573
32
+ - name : Checkout Actions
33
+ uses : actions/checkout@v3
34
+ with :
35
+ repository : 01-ai/actions
36
+ token : ${{ secrets.PAT_TO_CLONE_ACTIONS }}
37
+ path : actions
38
+ ref : main
39
+ # try to create a tag
40
+ -
uses :
SebRollen/[email protected]
41
+ id : read_version
42
+ with :
43
+ file : " pyproject.toml"
44
+ field : " tool.poetry.version"
45
+ - uses : rickstaa/action-create-tag@v1
46
+ id : " tag_create"
47
+ if : (github.ref_name == github.event.repository.default_branch) && !contains(steps.read_version.outputs.value, '-')
48
+ with :
49
+ tag : ${{ steps.read_version.outputs.value }}
24
50
25
- # build-and-push:
26
- # needs: basic-check
27
- # runs-on:
28
- # - arc
29
- # - cpu
30
- # steps:
31
- # - name: Checkout
32
- # uses: actions/checkout@v3
33
- # - name: Set proxy
34
- # run: |
35
- # echo "http_proxy=$http_proxy" >> $GITHUB_ENV
36
- # echo "https_proxy=$https_proxy" >> $GITHUB_ENV
37
- # - uses: 01-ai/actions/build_docker_image@main
38
- # id: build-and-push
39
- # with:
40
- # registry: ${{ vars.VOLCES_REGISTRY }}
41
- # namespace: ${{ vars.VOLCES_NAMESPACE }}
42
- # tags: 'latest'
43
- # username: ${{ secrets.VOLCES_USER }}
44
- # password: ${{ secrets.VOLCES_TOKEN }}
51
+ build-and-push :
52
+ runs-on :
53
+ - public
54
+ needs : basic-check
55
+ outputs :
56
+ primary_tag : ${{ steps.build-and-push.outputs.primary_tag }}
57
+ matrix : ${{ steps.build-and-push.outputs.matrix }}
58
+ steps :
59
+ - uses : actions/checkout@v3
60
+ - name : Checkout Actions
61
+ uses : actions/checkout@v3
62
+ with :
63
+ repository : 01-ai/actions
64
+ token : ${{ secrets.PAT_TO_CLONE_ACTIONS }}
65
+ path : actions
66
+ ref : main
67
+ - name : Set proxy
68
+ run : |
69
+ echo "http_proxy=$http_proxy" >> $GITHUB_ENV
70
+ echo "https_proxy=$https_proxy" >> $GITHUB_ENV
71
+ - name : Build Docker Image
72
+ id : build-and-push
73
+ uses : ./actions/build_docker_image
74
+ with :
75
+ registry : ${{ secrets.DEFAULT_REGISTRY }}
76
+ namespace : ci
77
+ tags : ${{ needs.basic-check.outputs.tag }}
78
+ username : ${{ secrets.DEFAULT_REGISTRY_USER }}
79
+ password : ${{ secrets.DEFAULT_REGISTRY_PASSWORD }}
0 commit comments