@@ -11,66 +11,14 @@ defaults:
1111 shell : bash
1212
1313jobs :
14- build-linux :
15- uses : ./.github/workflows/define- build-linux-image .yaml
14+ build-push- linux :
15+ uses : ./.github/workflows/build-push-linux .yaml
1616 secrets : inherit
17-
18- tag :
19- runs-on : self-hosted
20- steps :
21- - uses : mukunku/tag-exists-action@v1.6.0
22- id : check-tag
23- with :
24- tag : ${{ github.event.inputs.version_number }}
25- - name : Fail if tag exists
26- if : steps.check-tag.outputs.exists == 'true'
27- run : |
28- echo "Tag ${{ github.event.inputs.version_number }} exists!"
29- exit 1
30- - name : Print tag if it doesn't exist
31- if : steps.check-tag.outputs.exists == 'false'
32- run : |
33- echo "Tag ${{ github.event.inputs.version_number }} doesn't yet exist and can be created"
34-
35- push-linux :
36- needs : [tag, build-linux]
37- runs-on : [self-hosted, linux]
38- permissions :
39- contents : read
40- packages : write
41- steps :
42- - name : Login to GitHub Container Registry
43- uses : docker/login-action@v3
44- with :
45- registry : ghcr.io
46- username : ${{ github.repository_owner }}
47- password : ${{ secrets.GITHUB_TOKEN }}
48- - name : lowercase github.repository
49- run : |
50- echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
51- - name : Download cached docker image
52- run : |
53- curl -X GET http://192.168.0.11:25000/attachments/gha-runner/1/image_ubuntu.tar -o /tmp/image_ubuntu.tar
54- - name : Load image
55- run : |
56- docker load --input /tmp/image_ubuntu.tar
57- - name : Push
58- run : |
59- docker tag ${{ env.IMAGE_NAME }}:latest-ubuntu ghcr.io/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version_number }}-ubuntu
60- docker push ghcr.io/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version_number }}-ubuntu
61- docker tag ghcr.io/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version_number }}-ubuntu ghcr.io/${{ env.IMAGE_NAME }}:latest-ubuntu
62- docker push ghcr.io/${{ env.IMAGE_NAME }}:latest-ubuntu
63- - name : Remove local image
64- if : always()
65- run : |
66- docker image rm ${{ env.IMAGE_NAME }}:latest-ubuntu
67- - name : Remove cached docker image
68- if : always()
69- run : |
70- curl -X DELETE http://192.168.0.11:25000/attachments/gha-runner/1/image_ubuntu.tar
17+ with :
18+ version_number : ${{ github.event.inputs.version_number }}
7119
7220 release :
73- needs : [tag, build-linux, push-linux]
21+ needs : [build-push-linux]
7422 runs-on : [self-hosted, linux]
7523 permissions :
7624 contents : write
0 commit comments