forked from jflamy/owlcms4
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (59 loc) · 1.9 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Docker deploy
on:
push:
tags:
- 'v*.*.*'
paths-ignore:
- '*.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
id: build
run: docker build . -t dvfdocker/owlcms4:latest
shell: bash
- run: docker save dvfdocker/owlcms4:latest -o owlcms4.tar
- uses: actions/upload-artifact@v3
with:
name: owlcms4
path: owlcms4.tar
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Go offline using the pom.xml
run: mvn dependency:go-offline package -P production -am -pl owlcms -Dmaven.test.skip=true
- name: Build
run: mvn clean package -P production -am -pl owlcms -Dmaven.test.skip=true
- name: Run tests
run: mvn verify -am -pl owlcms
deploy:
runs-on: ubuntu-latest
needs: [test, build]
steps:
- uses: actions/download-artifact@v3
with:
name: owlcms4
- name: Get the version release
id: get_release_version
run: echo ::set-output name=VERSION::$(git describe --abbrev=0 --tags | cut -d "v" -f 2)
- run: docker load -i owlcms4.tar
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Tag builds
run: |-
docker tag dvfdocker/owlcms4:latest dvfdocker/owlcms4:latest
docker tag dvfdocker/owlcms4:latest dvfdocker/owlcms4:${{ steps.get_release_version.outputs.VERSION }}
- name: Push the version Docker image
run: docker push dvfdocker/owlcms4:${{ steps.get_release_version.outputs.VERSION }}
- name: Push the tagged Docker image
run: docker push dvfdocker/owlcms4:latest