File tree Expand file tree Collapse file tree 2 files changed +36
-15
lines changed Expand file tree Collapse file tree 2 files changed +36
-15
lines changed Original file line number Diff line number Diff line change
1
+ name : build_test_and_push_docker
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ # Only build containers when pushing to main
7
+ - " main"
8
+
9
+ env :
10
+ LATEST_TAG : NCAR/ccpp-scm:latest
11
+
12
+ jobs :
13
+ docker :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v4
18
+ - name : Set up QEMU
19
+ uses : docker/setup-qemu-action@v3
20
+ - name : Set up Docker Buildx
21
+ uses : docker/setup-buildx-action@v3
22
+ - name : Login to Docker Hub
23
+ uses : docker/login-action@v3
24
+ with :
25
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
26
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
27
+ - name : Push latest tag
28
+ uses : docker/build-push-action@v5
29
+ with :
30
+ context : .
31
+ file : docker/Dockerfile
32
+ platforms : linux/amd64,linux/arm64
33
+ push : true
34
+ tags : ${{ env.LATEST_TAG }}
Original file line number Diff line number Diff line change 1
1
name : build_test_and_push_docker
2
2
3
- on :
4
- push :
5
- # branches:
6
- # - "main"
3
+ on : [pull_request,workflow_dispatch]
7
4
8
5
env :
9
- TEST_TAG : mkavulich/ccpp-scm:test
10
- LATEST_TAG : mkavulich/ccpp-scm:latest
6
+ TEST_TAG : NCAR/ccpp-scm:test
11
7
12
8
jobs :
13
9
docker :
33
29
tags : ${{ env.TEST_TAG }}
34
30
- name : Test
35
31
run : |
36
- docker pull ${{ env.TEST_TAG }}
37
32
mkdir $HOME/output
38
33
chmod a+rw $HOME/output
39
34
docker run --rm -v $HOME/output:/home ${{ env.TEST_TAG }} ./run_scm.py -f ../../test/rt_test_cases.py --runtime_mult 0.1 -d
40
- - name : Push latest tag
41
- uses : docker/build-push-action@v5
42
- with :
43
- context : .
44
- file : docker/Dockerfile
45
- platforms : linux/amd64,linux/arm64
46
- push : true
47
- tags : ${{ env.LATEST_TAG }}
You can’t perform that action at this time.
0 commit comments