File tree 3 files changed +68
-3
lines changed
3 files changed +68
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ pull_request :
7
+ workflow_dispatch :
8
+
9
+ concurrency :
10
+ group :
11
+ ${{ github.workflow }}-${{ github.ref_name }}-${{
12
+ github.event.pull_request.number || github.sha }}
13
+ cancel-in-progress : true
14
+
15
+ jobs :
16
+ build :
17
+ name : " build image"
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - uses : actions/checkout@v4
21
+
22
+ - name : Set up Docker Buildx
23
+ uses : docker/setup-buildx-action@v3
24
+
25
+ - name : Build and export
26
+ uses : docker/build-push-action@v6
27
+ with :
28
+ tags : uv-docker-example:latest
29
+ cache-from : type=gha,scope=uv-docker-example
30
+ cache-to : type=gha,mode=min,scope=uv-docker-example
31
+ outputs : type=docker,dest=/tmp/uv-docker-example.tar
32
+
33
+ - name : Upload artifact
34
+ uses : actions/upload-artifact@v4
35
+ with :
36
+ name : uv-docker-example
37
+ path : /tmp/uv-docker-example.tar
38
+
39
+ test :
40
+ name : " test image"
41
+ runs-on : ubuntu-latest
42
+ needs : build
43
+ steps :
44
+ - uses : actions/checkout@v4
45
+
46
+ - name : Download artifact
47
+ uses : actions/download-artifact@v4
48
+ with :
49
+ name : uv-docker-example
50
+ path : /tmp
51
+
52
+ - name : Load image
53
+ run : |
54
+ docker load --input /tmp/uv-docker-example.tar
55
+ docker image ls -a
56
+
57
+ - name : Test image
58
+ run : ./run.sh hello
Original file line number Diff line number Diff line change 12
12
# -it $(docker build -q .) Build the image, then use it as a run target
13
13
# $@ Pass any arguments to the container
14
14
15
+ if [ -t 1 ]; then
16
+ INTERACTIVE=" -it"
17
+ else
18
+ INTERACTIVE=" "
19
+ fi
20
+
15
21
docker run \
16
22
--rm \
17
23
--volume .:/app \
18
24
--volume /app/.venv \
19
- -it $( docker build -q .) \
20
- $@
25
+ $INTERACTIVE \
26
+ $( docker build -q .) \
27
+ " $@ "
Original file line number Diff line number Diff line change 1
1
def hello () -> str :
2
- return "Hello from uv-docker-example!"
2
+ print ( "Hello from uv-docker-example!" )
You can’t perform that action at this time.
0 commit comments