File tree Expand file tree Collapse file tree 2 files changed +32
-16
lines changed
Expand file tree Collapse file tree 2 files changed +32
-16
lines changed Original file line number Diff line number Diff line change 3636
3737 - name : Test cli works in cached runtime image
3838 run : docker run --rm tag_for_testing --version
39-
40- - name : Upload container as artifact
41- uses : actions/upload-artifact@v4
42- with :
43- name : container
44- path : ${{ runner.temp }}/myimage.tar
Original file line number Diff line number Diff line change 22 workflow_call :
33
44jobs :
5- push :
5+ build :
66 runs-on : ubuntu-latest
77
88 steps :
9- - name : Download container artifact
10- uses : actions/download-artifact @v4
9+ - name : Checkout
10+ uses : actions/checkout @v4
1111 with :
12- name : container
13- path : ${{ runner.temp }}
14-
15- - name : Load image
16- run : |
17- docker load --input ${{ runner.temp}}/myimage.tar
18-
12+ # Need this to get version number from last tag
13+ fetch-depth : 0
14+
15+ - name : Set up Docker Buildx
16+ id : buildx
17+ uses : docker/setup-buildx-action@v3
18+
19+ - name : Log in to GitHub Docker Registry
20+ if : github.event_name != 'pull_request'
21+ uses : docker/login-action@v3
22+ with :
23+ registry : ghcr.io
24+ username : ${{ github.actor }}
25+ password : ${{ secrets.GITHUB_TOKEN }}
26+
27+ - name : Build and export to Docker local cache
28+ uses : docker/build-push-action@v6
29+ env :
30+ DOCKER_BUILD_RECORD_UPLOAD : false
31+ with :
32+ context : .
33+ # Need load and tags so we can test it below
34+ load : true
35+ tags : tag_for_testing
36+
37+ - name : Test cli works in cached runtime image
38+ run : docker run --rm tag_for_testing --version
39+
1940 - name : Create tags for publishing image
2041 id : meta
2142 uses : docker/metadata-action@v5
3354 # This does not build the image again, it will find the image in the
3455 # Docker cache and publish it
3556 with :
57+ context : .
3658 push : true
3759 tags : ${{ steps.meta.outputs.tags }}
3860 labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments