-
Notifications
You must be signed in to change notification settings - Fork 21
65 lines (60 loc) · 1.92 KB
/
maven.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
62
63
64
65
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: AdminLTE3
env:
MYSQL_DATABASE: lte
MYSQL_USER: root
MYSQL_PASSWORD: 'root'
MYSQL_HOST: localhost
NODE_ENV: test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
# services:
# mysql8:
# image: mysql
# ports:
# - 3306/tcp
# env:
# MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
# MYSQL_USER: ${{ env.MYSQL_USER }}
# MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
# MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# options: >-
# --name=mysql8
# --health-cmd="mysqladmin ping"
# --health-interval=10s
# --health-timeout=5s
# --health-retries=3
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE lte;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Maven Install
run: mvn clean install
- name: Build & push Docker image
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: hendisantika/adminlte3
tags: latest
registry: docker.io
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}