This repository was archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (95 loc) · 3 KB
/
dockerimage.yml
File metadata and controls
101 lines (95 loc) · 3 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Docker Image CI
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.txt'
- 'docker-build.sh'
- 'native-image-filter.json'
- 'systemd/**'
- 'media/**'
- 'docs/**'
- 'lombok.config'
- '.gitignore'
- '**.gitkeep'
pull_request:
branches: [ master ]
jobs:
java-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Set up GraalVM
uses: DeLaGuardo/setup-graalvm@master
with:
graalvm-version: '21.0.0.java11'
- name: Setup Maven
uses: stCarolas/setup-maven@v4
with:
# Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0
maven-version: 3.6.3
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package --file pom.xml
- uses: whoan/docker-build-with-cache-action@v5
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
image_name: mdsina/corona-slack
image_tag: latest
# - name: executing remote ssh commands using password
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.SSH_PASSWORD }}
# port: ${{ secrets.SSH_PORT }}
# script: systemctl restart corona
# - name: Build the Docker image
# run: docker build . -t corona-slack
# native-image-build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - name: Set up GraalVM
# uses: DeLaGuardo/setup-graalvm@3
# with:
# graalvm-version: '20.0.0.java11'
# - name: Setup Maven
# uses: stCarolas/setup-maven@v1
# with:
# # Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0
# maven-version: 3.6.3
# - uses: actions/cache@v1
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
# - name: Build with Maven
# run: mvn -B package --file pom.xml
# - uses: whoan/docker-build-with-cache-action@master
# with:
# dockerfile: ./Dockerfile.native-image
# username: "${{ secrets.DOCKER_USERNAME }}"
# password: "${{ secrets.DOCKER_PASSWORD }}"
# image_name: mdsina/corona-slack
# image_tag: native-image-latest
## - name: executing remote ssh commands using password
## uses: appleboy/ssh-action@master
## with:
## host: ${{ secrets.SSH_HOST }}
## username: ${{ secrets.SSH_USERNAME }}
## password: ${{ secrets.SSH_PASSWORD }}
## port: ${{ secrets.SSH_PORT }}
## script: systemctl restart docker.corona-slack.service
## - name: Build the Docker image
## run: docker build . -t corona-slack