@@ -16,15 +16,15 @@ jobs:
16
16
runs-on : ubuntu-latest
17
17
strategy :
18
18
matrix :
19
- node-version : [12 .x, 14 .x]
20
- mongodb-version : [4.2, 4.4 ]
19
+ node-version : [14 .x, 16 .x]
20
+ mongodb-version : [4.4, 5.0, 6.0 ]
21
21
22
22
steps :
23
23
- name : Git Checkout
24
- uses : actions/checkout@v2
24
+ uses : actions/checkout@v3
25
25
26
26
- name : Use Node.js ${{ matrix.node-version }}
27
- uses : actions/setup-node@v1
27
+ uses : actions/setup-node@v3
28
28
with :
29
29
node-version : ${{ matrix.node-version }}
30
30
@@ -40,54 +40,51 @@ jobs:
40
40
- name : Send Coverage
41
41
run : npm run-script coverage
42
42
43
- publish_dev :
44
- name : Publish dev branch to Docker Hub
43
+ publish :
44
+ name : Publish to Docker Hub
45
45
needs : test
46
46
runs-on : ubuntu-latest
47
- if : github.ref == 'refs/heads/dev' && github.repository_owner == 'nightscout'
47
+ if : ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ dev') && github.repository_owner == 'nightscout'
48
48
env :
49
49
DOCKER_IMAGE : nightscout/cgm-remote-monitor
50
+ PLATFORMS : linux/amd64,linux/arm64
50
51
steps :
52
+ - name : Set up QEMU
53
+ uses : docker/setup-qemu-action@v1
54
+ - name : Set up Docker Buildx
55
+ uses : docker/setup-buildx-action@v1
51
56
- name : Login to Docker Hub
52
57
uses : docker/login-action@v1
53
58
with :
54
59
username : ${{ secrets.DOCKER_USER }}
55
60
password : ${{ secrets.DOCKER_PASS }}
56
61
- name : Clean git Checkout
57
62
if : success()
58
- uses : actions/checkout@v2
63
+ uses : actions/checkout@v3
59
64
- name : Build, tag and push the dev Docker image
60
- if : success()
61
- run : |
62
- docker build --no-cache=true -t ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} .
63
- docker image push ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }}
64
- docker tag ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} ${{ env.DOCKER_IMAGE }}:latest_dev
65
- docker image push ${{ env.DOCKER_IMAGE }}:latest_dev
66
-
67
- publish_master :
68
- name : Publish master branch to Docker Hub
69
- needs : test
70
- runs-on : ubuntu-latest
71
- if : github.ref == 'refs/heads/master' && github.repository_owner == 'nightscout'
72
- env :
73
- DOCKER_IMAGE : nightscout/cgm-remote-monitor
74
- steps :
75
- - name : Login to Docker Hub
76
- uses : docker/login-action@v1
65
+ if : success() && github.ref == 'refs/heads/dev'
66
+ uses : docker/build-push-action@v2
77
67
with :
78
- username : ${{ secrets.DOCKER_USER }}
79
- password : ${{ secrets.DOCKER_PASS }}
80
- - name : Clean git Checkout
81
- if : success()
82
- uses : actions/checkout@v2
83
- - name : get-npm-version
84
- if : success()
68
+ context : .
69
+ push : true
70
+ no-cache : true
71
+ platforms : ${{ env.PLATFORMS }}
72
+ tags : |
73
+ ${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }}
74
+ ${{ env.DOCKER_IMAGE }}:latest_dev
75
+
76
+ - name : Get Nightscout release version
77
+ if : success() && github.ref == 'refs/heads/master'
85
78
id : package-version
86
79
uses : martinbeentjes/npm-get-version-action@master
87
80
- name : Build, tag and push the master Docker image
88
- if : success()
89
- run : |
90
- docker build --no-cache=true -t ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} .
91
- docker image push ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }}
92
- docker tag ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} ${{ env.DOCKER_IMAGE }}:latest
93
- docker image push ${{ env.DOCKER_IMAGE }}:latest
81
+ if : success() && github.ref == 'refs/heads/master'
82
+ uses : docker/build-push-action@v2
83
+ with :
84
+ context : .
85
+ push : true
86
+ no-cache : true
87
+ platforms : ${{ env.PLATFORMS }}
88
+ tags : |
89
+ ${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }}
90
+ ${{ env.DOCKER_IMAGE }}:latest
0 commit comments